openagent 0.7.2 → 0.7.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module OpenAgent
2
- VERSION = '0.7.2' unless defined?(OpenAgent::VERSION)
2
+ VERSION = '0.7.3' unless defined?(OpenAgent::VERSION)
3
3
  end
@@ -5,7 +5,7 @@ module SIF
5
5
  include Virtus.model
6
6
 
7
7
  attribute :type
8
- attribute :value, Float
8
+ attribute :value
9
9
  end
10
10
  end
11
11
  end
@@ -6,7 +6,7 @@ module SIF
6
6
  include Virtus.model
7
7
 
8
8
  attribute :code
9
- attribute :other_codes
9
+ attribute :other_codes, Array[MODEL_COMMON::OtherCode]
10
10
  end
11
11
  end
12
12
  end
@@ -8,7 +8,7 @@ module SIF
8
8
  include Virtus.model
9
9
  include SISRepresenter
10
10
 
11
- attribute :school_course_info_ref_id, String
11
+ attribute :school_info_ref_id, String
12
12
  attribute :school_year, String
13
13
  attribute :course_code, String
14
14
  attribute :state_course_code, String
@@ -11,7 +11,7 @@ module SIF
11
11
  attribute :school_year, String
12
12
  attribute :entry_date, Date
13
13
  attribute :exit_date, Date
14
- attribute :schedule_info_overrides, Common::ScheduleInfoOverride
14
+ attribute :schedule_info_overrides, Array[Common::ScheduleInfoOverride]
15
15
  attribute :credits_attempted, Common::CreditsAttempted
16
16
 
17
17
  end
@@ -9,16 +9,18 @@ module SIF
9
9
 
10
10
  self.representation_wrap = 'ContactInfo'
11
11
 
12
- property :name, :as => 'Name'
13
- property :position_title => 'PositionTitle'
14
- property :role => 'Role'
15
- collection :emails => 'Email', :wrap => 'EmailList',
12
+ property :name, :as => 'Name',
13
+ :class => MODEL_COMMON::Name,
14
+ :decorator => REPR_COMMON::Name
15
+ property :position_title, :as => 'PositionTitle'
16
+ property :role, :as => 'Role'
17
+ collection :emails, :as => 'Email', :wrap => 'EmailList',
16
18
  :class => MODEL_COMMON::Email,
17
19
  :decorator => REPR_COMMON::Email
18
- property :address => 'Address',
20
+ property :address, :as => 'Address',
19
21
  :class => MODEL_COMMON::Address,
20
22
  :decorator => REPR_COMMON::Address
21
- collection :phone_numbers => 'PhoneNumber', :wrap => 'PhoneNumberList',
23
+ collection :phone_numbers, :as => 'PhoneNumber', :wrap => 'PhoneNumberList',
22
24
  :class => MODEL_COMMON::PhoneNumber,
23
25
  :decorator => REPR_COMMON::PhoneNumber
24
26
  end
@@ -3,7 +3,7 @@ module SIF
3
3
  module Model
4
4
  module Group
5
5
  module DataModel
6
- class TermSpan < Representable::Decorator
6
+ class TermSpan < SIF::Represent
7
7
  self.representation_wrap = 'TermSpan'
8
8
 
9
9
  collection :other_codes, :as => 'OtherCode', :wrap => 'OtherCodeList',
@@ -12,12 +12,12 @@ module SIF
12
12
  property :school_year, :attribute => true, :as => 'SchoolYear'
13
13
  property :entry_date, :as => 'EntryDate'
14
14
  property :exit_date, :as => 'ExitDate'
15
- property :schedule_info_overrides, :as => 'ScheduleInfoOverride', :wrap => 'ScheduleInfoOverrideList',
15
+ collection :schedule_info_overrides, :as => 'ScheduleInfoOverride', :wrap => 'ScheduleInfoOverrideList',
16
16
  :class => MODEL_COMMON::ScheduleInfoOverride,
17
17
  :decorator => REPR_COMMON::ScheduleInfoOverride
18
18
  property :credits_attempted, :as => 'CreditsAttempted',
19
19
  :class => MODEL_COMMON::CreditsAttempted,
20
- :class => REPR_COMMON::CreditsAttempted
20
+ :decorator => REPR_COMMON::CreditsAttempted
21
21
  end
22
22
  end
23
23
  end
@@ -0,0 +1,63 @@
1
+ <SchoolInfo RefId="D3E34B359D75101A8C3D00AA001A1652">
2
+ <LocalId>946379881</LocalId>
3
+ <StateProvinceId>C2345681</StateProvinceId>
4
+ <NCESId>421575003045</NCESId>
5
+ <SchoolName>Lincoln High School</SchoolName>
6
+ <SchoolType>K12</SchoolType>
7
+ <LEAInfoRefId>73648462888624AA5294BC6380173276</LEAInfoRefId>
8
+ <OtherLEA SIF_RefObject="LEAInfo">AA648462888624AA5294BC638017320B</OtherLEA>
9
+ <SchoolFocusList>
10
+ <SchoolFocus>Regular</SchoolFocus>
11
+ </SchoolFocusList>
12
+ <SchoolURL>http://www.lincolnhs.edu</SchoolURL>
13
+ <PrincipalInfo>
14
+ <ContactName>Richard Knudson</ContactName>
15
+ <ContactTitle>Dr.</ContactTitle>
16
+ </PrincipalInfo>
17
+ <SchoolContactList>
18
+ <SchoolContact>
19
+ <PublishInDirectory>Yes</PublishInDirectory>
20
+ <ContactInfo>
21
+ <Name Type="04">
22
+ <LastName>Miller</LastName>
23
+ <FirstName>James</FirstName>
24
+ </Name>
25
+ <PositionTitle>Office Assistant</PositionTitle>
26
+ <EmailList>
27
+ <Email Type="Primary">jmiller@lhs.k12.state.us</Email>
28
+ </EmailList>
29
+ <PhoneNumberList>
30
+ <PhoneNumber Type="0096">
31
+ <Number>(555) 555-1235</Number>
32
+ </PhoneNumber>
33
+ </PhoneNumberList>
34
+ </ContactInfo>
35
+ </SchoolContact>
36
+ </SchoolContactList>
37
+ <PhoneNumberList>
38
+ <PhoneNumber Type="0096">
39
+ <Number>(555) 555-1234</Number>
40
+ </PhoneNumber>
41
+ </PhoneNumberList>
42
+ <IdentificationInfoList>
43
+ <IdentificationInfo Code="0175">00123</IdentificationInfo>
44
+ </IdentificationInfoList>
45
+ <SessionType>0830</SessionType>
46
+ <GradeLevels>
47
+ <GradeLevel>
48
+ <Code>09</Code>
49
+ </GradeLevel>
50
+ <GradeLevel>
51
+ <Code>10</Code>
52
+ </GradeLevel>
53
+ <GradeLevel>
54
+ <Code>11</Code>
55
+ </GradeLevel>
56
+ <GradeLevel>
57
+ <Code>12</Code>
58
+ </GradeLevel>
59
+ </GradeLevels>
60
+ <Title1Status>Targeted</Title1Status>
61
+ <OperationalStatus>0820</OperationalStatus>
62
+ <CongressionalDistrict>3</CongressionalDistrict>
63
+ </SchoolInfo>
@@ -0,0 +1,39 @@
1
+ <StudentSectionEnrollment RefId="983AC16598793002C3D00AA00456789D" StudentPersonalRefId="CAE293165987101A8C3D00AA00456789" SectionInfoRefId="9076AB23E386112B7EA2256100BB3312" SchoolYear="2002">
2
+ <EntryDate>2001-09-05</EntryDate>
3
+ <ExitDate>2002-03-01</ExitDate>
4
+ <ScheduleInfoOverrideList>
5
+ <ScheduleInfoOverride Override="Yes" TermInfoRefId="099BBC3227490063E97403434C5C2207">
6
+ <MeetingTimeList>
7
+ <MeetingTime>
8
+ <TimetableDay>M</TimetableDay>
9
+ <TimetablePeriod>6</TimetablePeriod>
10
+ </MeetingTime>
11
+ <MeetingTime>
12
+ <TimetableDay>W</TimetableDay>
13
+ <TimetablePeriod>6</TimetablePeriod>
14
+ </MeetingTime>
15
+ <MeetingTime>
16
+ <TimetableDay>F</TimetableDay>
17
+ <TimetablePeriod>6</TimetablePeriod>
18
+ </MeetingTime>
19
+ </MeetingTimeList>
20
+ </ScheduleInfoOverride>
21
+ <ScheduleInfoOverride Override="Yes" TermInfoRefId="A2334007263E97403434C5C220798765">
22
+ <MeetingTimeList>
23
+ <MeetingTime>
24
+ <TimetableDay>M</TimetableDay>
25
+ <TimetablePeriod>4</TimetablePeriod>
26
+ </MeetingTime>
27
+ <MeetingTime>
28
+ <TimetableDay>W</TimetableDay>
29
+ <TimetablePeriod>4</TimetablePeriod>
30
+ </MeetingTime>
31
+ <MeetingTime>
32
+ <TimetableDay>F</TimetableDay>
33
+ <TimetablePeriod>4</TimetablePeriod>
34
+ </MeetingTime>
35
+ </MeetingTimeList>
36
+ </ScheduleInfoOverride>
37
+ </ScheduleInfoOverrideList>
38
+ <CreditsAttempted Type="0588">1</CreditsAttempted>
39
+ </StudentSectionEnrollment>
@@ -0,0 +1,14 @@
1
+ <TermInfo RefId="7E59D75101A80A70016375DE097A0726" SchoolInfoRefId="A2E35B359D75101A8C3D00AA001A0000" SchoolYear="2004">
2
+ <StartDate>2003-01-05</StartDate>
3
+ <EndDate>2004-04-01</EndDate>
4
+ <Description>Spring Semester 2004</Description>
5
+ <RelativeDuration>0.1333</RelativeDuration>
6
+ <TermCode>Sp2004</TermCode>
7
+ <Track>PreK</Track>
8
+ <TermSpan>
9
+ <Code>0828</Code>
10
+ <OtherCodeList>
11
+ <OtherCode Codeset="Text">Semester</OtherCode>
12
+ </OtherCodeList>
13
+ </TermSpan>
14
+ </TermInfo>
@@ -0,0 +1,46 @@
1
+ require_relative 'spec_helper'
2
+
3
+ describe SIF::Representation::Model::Group::SIS::SchoolInfo do
4
+ let(:xml) { File.read(fixture('sif/school_info.xml')) }
5
+ let(:school_info) { SIF::Model::Group::SIS::SchoolInfo.new }
6
+
7
+ before do
8
+ SIF::Representation::Model::Group::SIS::SchoolInfo.new(school_info).from_xml(xml)
9
+ end
10
+
11
+ it 'parses' do
12
+ school_info.ref_id.should == 'D3E34B359D75101A8C3D00AA001A1652'
13
+ school_info.local_id.should == '946379881'
14
+ school_info.state_province_id == 'C2345681'
15
+ school_info.nces_id.should == '421575003045'
16
+ school_info.school_name.should == 'Lincoln High School'
17
+ school_info.lea_info_ref_id.should == '73648462888624AA5294BC6380173276'
18
+ school_info.school_type.should == 'K12'
19
+ school_info.other_lea.include?('AA648462888624AA5294BC638017320B').should == true
20
+ school_info.school_focuses[0].should == 'Regular'
21
+ school_info.school_url.should == 'http://www.lincolnhs.edu'
22
+ school_info.principal_info.contact_name.should == 'Richard Knudson'
23
+ school_info.principal_info.contact_title.should == 'Dr.'
24
+ school_contact = school_info.school_contacts[0]
25
+ school_contact.publish_in_directory.should == 'Yes'
26
+ contact_info = school_contact.contact_info
27
+ contact_info.name.type.should == '04'
28
+ contact_info.name.first_name.should == 'James'
29
+ contact_info.name.last_name.should == 'Miller'
30
+ contact_info.position_title.should == 'Office Assistant'
31
+ contact_info.emails[0].type.should == 'Primary'
32
+ contact_info.emails[0].value.should == 'jmiller@lhs.k12.state.us'
33
+ contact_info.phone_numbers[0].type.should == '0096'
34
+ contact_info.phone_numbers[0].number.should == '(555) 555-1235'
35
+ school_info.phone_numbers[0].type.should == '0096'
36
+ school_info.phone_numbers[0].number.should == '(555) 555-1234'
37
+ school_info.session_type.should == '0830'
38
+ school_info.grade_levels.include?('09').should == true
39
+ school_info.grade_levels.include?('10').should == true
40
+ school_info.grade_levels.include?('11').should == true
41
+ school_info.grade_levels.include?('12').should == true
42
+ school_info.title_1_status.should == 'Targeted'
43
+ school_info.operational_status.should == '0820'
44
+ school_info.congressional_district.should == '3'
45
+ end
46
+ end
@@ -0,0 +1,45 @@
1
+ require_relative 'spec_helper'
2
+
3
+ describe SIF::Representation::Model::Group::SIS::StudentSectionEnrollment do
4
+ let(:xml) { File.read(fixture('sif/student_section_enrollment.xml')) }
5
+ let(:student_se) { SIF::Model::Group::SIS::StudentSectionEnrollment.new }
6
+
7
+ before do
8
+ SIF::Representation::Model::Group::SIS::StudentSectionEnrollment.new(student_se).from_xml(xml)
9
+ end
10
+
11
+ it 'parses' do
12
+ student_se.ref_id.should == '983AC16598793002C3D00AA00456789D'
13
+ student_se.student_personal_ref_id.should == 'CAE293165987101A8C3D00AA00456789'
14
+ student_se.section_info_ref_id.should == '9076AB23E386112B7EA2256100BB3312'
15
+ student_se.school_year.should == '2002'
16
+ student_se.entry_date.to_s.should == '2001-09-05'
17
+ student_se.exit_date.to_s.should == '2002-03-01'
18
+ sched_override = student_se.schedule_info_overrides[0]
19
+ sched_override.override.should == 'Yes'
20
+ sched_override.term_info_ref_id.should == '099BBC3227490063E97403434C5C2207'
21
+ meeting_time = sched_override.meeting_times[0]
22
+ meeting_time.timetable_day.should == 'M'
23
+ meeting_time.timetable_period.should == '6'
24
+ meeting_time = sched_override.meeting_times[1]
25
+ meeting_time.timetable_day.should == 'W'
26
+ meeting_time.timetable_period.should == '6'
27
+ meeting_time = sched_override.meeting_times[2]
28
+ meeting_time.timetable_day.should == 'F'
29
+ meeting_time.timetable_period.should == '6'
30
+ sched_override = student_se.schedule_info_overrides[1]
31
+ sched_override.override.should == 'Yes'
32
+ sched_override.term_info_ref_id.should == 'A2334007263E97403434C5C220798765'
33
+ meeting_time = sched_override.meeting_times[0]
34
+ meeting_time.timetable_day.should == 'M'
35
+ meeting_time.timetable_period.should == '4'
36
+ meeting_time = sched_override.meeting_times[1]
37
+ meeting_time.timetable_day.should == 'W'
38
+ meeting_time.timetable_period.should == '4'
39
+ meeting_time = sched_override.meeting_times[2]
40
+ meeting_time.timetable_day.should == 'F'
41
+ meeting_time.timetable_period.should == '4'
42
+ student_se.credits_attempted.type.should == '0588'
43
+ student_se.credits_attempted.value.should == '1'
44
+ end
45
+ end
@@ -0,0 +1,26 @@
1
+ require_relative 'spec_helper'
2
+
3
+ describe SIF::Representation::Model::Group::SIS::TermInfo do
4
+ let(:xml) { File.read(fixture('sif/term_info.xml')) }
5
+ let(:term_info) { SIF::Model::Group::SIS::TermInfo.new }
6
+
7
+ before do
8
+ SIF::Representation::Model::Group::SIS::TermInfo.new(term_info).from_xml(xml)
9
+ end
10
+
11
+ it 'parses' do
12
+ term_info.ref_id.should == '7E59D75101A80A70016375DE097A0726'
13
+ term_info.school_info_ref_id.should == 'A2E35B359D75101A8C3D00AA001A0000'
14
+ term_info.school_year.should == '2004'
15
+ term_info.start_date.to_s.should == '2003-01-05'
16
+ term_info.end_date.to_s.should == '2004-04-01'
17
+ term_info.description.should == 'Spring Semester 2004'
18
+ term_info.relative_duration.should == 0.1333
19
+ term_info.term_code.should == 'Sp2004'
20
+ term_info.track.should == 'PreK'
21
+ term_span = term_info.term_span
22
+ term_span.code.should == '0828'
23
+ term_span.other_codes[0].value.should == 'Semester'
24
+ term_span.other_codes[0].code_set.should == 'Text'
25
+ end
26
+ end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openagent
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.2
4
+ version: 0.7.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -357,6 +357,7 @@ files:
357
357
  - spec/fixtures/sif/discipline_incident.xml
358
358
  - spec/fixtures/sif/lea_info.xml
359
359
  - spec/fixtures/sif/school_course_info.xml
360
+ - spec/fixtures/sif/school_info.xml
360
361
  - spec/fixtures/sif/section_info.xml
361
362
  - spec/fixtures/sif/sif_header.xml
362
363
  - spec/fixtures/sif/sif_message__response.xml
@@ -372,6 +373,8 @@ files:
372
373
  - spec/fixtures/sif/staff_personal.xml
373
374
  - spec/fixtures/sif/stu_pers_resp.xml
374
375
  - spec/fixtures/sif/student_personal.xml
376
+ - spec/fixtures/sif/student_section_enrollment.xml
377
+ - spec/fixtures/sif/term_info.xml
375
378
  - spec/fixtures/zone.yaml
376
379
  - spec/message_builder_spec.rb
377
380
  - spec/response_spec.rb
@@ -385,10 +388,13 @@ files:
385
388
  - spec/sif/representations/xml/request_spec.rb
386
389
  - spec/sif/representations/xml/response_spec.rb
387
390
  - spec/sif/representations/xml/school_course_info_spec.rb
391
+ - spec/sif/representations/xml/school_info_spec.rb
388
392
  - spec/sif/representations/xml/section_info_spec.rb
389
393
  - spec/sif/representations/xml/spec_helper.rb
390
394
  - spec/sif/representations/xml/staff_personal_spec.rb
391
395
  - spec/sif/representations/xml/student_personal_spec.rb
396
+ - spec/sif/representations/xml/student_section_enrollment_spec.rb
397
+ - spec/sif/representations/xml/term_info_spec.rb
392
398
  - spec/spec_helper.rb
393
399
  - spec/zone_spec.rb
394
400
  homepage: http://github.com/cwhiteley/openagent
@@ -428,6 +434,7 @@ test_files:
428
434
  - spec/fixtures/sif/discipline_incident.xml
429
435
  - spec/fixtures/sif/lea_info.xml
430
436
  - spec/fixtures/sif/school_course_info.xml
437
+ - spec/fixtures/sif/school_info.xml
431
438
  - spec/fixtures/sif/section_info.xml
432
439
  - spec/fixtures/sif/sif_header.xml
433
440
  - spec/fixtures/sif/sif_message__response.xml
@@ -443,6 +450,8 @@ test_files:
443
450
  - spec/fixtures/sif/staff_personal.xml
444
451
  - spec/fixtures/sif/stu_pers_resp.xml
445
452
  - spec/fixtures/sif/student_personal.xml
453
+ - spec/fixtures/sif/student_section_enrollment.xml
454
+ - spec/fixtures/sif/term_info.xml
446
455
  - spec/fixtures/zone.yaml
447
456
  - spec/message_builder_spec.rb
448
457
  - spec/response_spec.rb
@@ -456,10 +465,13 @@ test_files:
456
465
  - spec/sif/representations/xml/request_spec.rb
457
466
  - spec/sif/representations/xml/response_spec.rb
458
467
  - spec/sif/representations/xml/school_course_info_spec.rb
468
+ - spec/sif/representations/xml/school_info_spec.rb
459
469
  - spec/sif/representations/xml/section_info_spec.rb
460
470
  - spec/sif/representations/xml/spec_helper.rb
461
471
  - spec/sif/representations/xml/staff_personal_spec.rb
462
472
  - spec/sif/representations/xml/student_personal_spec.rb
473
+ - spec/sif/representations/xml/student_section_enrollment_spec.rb
474
+ - spec/sif/representations/xml/term_info_spec.rb
463
475
  - spec/spec_helper.rb
464
476
  - spec/zone_spec.rb
465
477
  has_rdoc: