openagent 0.7.8 → 0.8.0

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.8' unless defined?(OpenAgent::VERSION)
2
+ VERSION = '0.8.0' unless defined?(OpenAgent::VERSION)
3
3
  end
@@ -12,6 +12,10 @@ module SIF
12
12
  def first_meeting_time
13
13
  meeting_times.first || Common::MeetingTime.new
14
14
  end
15
+
16
+ def first_teacher
17
+ teachers.first || String.new
18
+ end
15
19
  end
16
20
  end
17
21
  end
@@ -5,14 +5,14 @@ module SIF
5
5
  class AttendanceCodeInfo
6
6
  include Virtus.model
7
7
 
8
- attribute :ref_id, String
8
+ attribute :ref_id, String
9
9
  attribute :school_info_ref_id, String
10
- attribute :attendance_code, String
11
- attribute :attendance_type, String
12
- attribute :attendance_status, String
13
- attribute :description, String
14
- attribute :absence_value, Float
15
- attribute :used_for_daily_attendance, Boolean
10
+ attribute :attendance_code, String
11
+ attribute :attendance_type, String
12
+ attribute :attendance_status, String
13
+ attribute :description, String
14
+ attribute :absence_value, Float
15
+ attribute :used_for_daily_attendance, Boolean
16
16
  attribute :used_for_period_attendance, Boolean
17
17
  attribute :metadata
18
18
  attribute :extended_elements
@@ -7,12 +7,12 @@ module SIF
7
7
  class CalendarDate
8
8
  include Virtus.model
9
9
 
10
- attribute :date, Date
10
+ attribute :date, Date
11
11
  attribute :calendar_summary_ref_id, String
12
- attribute :school_info_ref_id, String
13
- attribute :school_year, Integer
14
- attribute :calendar_date_type, String
15
- attribute :calendar_date_number, Integer
12
+ attribute :school_info_ref_id, String
13
+ attribute :school_year, Integer
14
+ attribute :calendar_date_type, String
15
+ attribute :calendar_date_number, Integer
16
16
  attribute :student_attendance
17
17
  attribute :teacher_attendance
18
18
  attribute :administrator_attendance
@@ -7,15 +7,15 @@ module SIF
7
7
  class DisciplineIncident
8
8
  include Virtus.model
9
9
 
10
- attribute :ref_id, String
11
- attribute :school_year, Integer
10
+ attribute :ref_id, String
11
+ attribute :school_year, Integer
12
12
  attribute :agency_reporting
13
- attribute :incident_number, String
14
- attribute :incident_date, Date
15
- attribute :incident_time, Time
13
+ attribute :incident_number, String
14
+ attribute :incident_date, Date
15
+ attribute :incident_time, Time
16
16
  attribute :incident_location, String
17
17
  attribute :incident_location_ref_id, String
18
- attribute :incident_cost, String
18
+ attribute :incident_cost, String
19
19
  attribute :incident_reporter
20
20
  attribute :related_tos
21
21
  attribute :weapon_types
@@ -5,19 +5,19 @@ module SIF
5
5
  class LEAInfo
6
6
  include Virtus.model
7
7
 
8
- attribute :ref_id, String
9
- attribute :local_id, String
10
- attribute :state_province_id, String
11
- attribute :nces_id, String
12
- attribute :lea_name, String
13
- attribute :lea_url, String
14
- attribute :education_agency_type, Integer
15
- attribute :lea_contacts, Array[String]
16
- attribute :phone_numbers, Array[Common::PhoneNumber]
17
- attribute :addresses, Array[Common::Address]
18
- attribute :identification_infos, Array[String]
8
+ attribute :ref_id, String
9
+ attribute :local_id, String
10
+ attribute :state_province_id, String
11
+ attribute :nces_id, String
12
+ attribute :lea_name, String
13
+ attribute :lea_url, String
14
+ attribute :education_agency_type, Integer
15
+ attribute :lea_contacts, Array[String]
16
+ attribute :phone_numbers, Array[Common::PhoneNumber]
17
+ attribute :addresses, Array[Common::Address]
18
+ attribute :identification_infos, Array[String]
19
19
  attribute :grade_levels
20
- attribute :operational_status, String
20
+ attribute :operational_status, String
21
21
  attribute :congressional_district, String
22
22
  attribute :metadata
23
23
  attribute :extended_elements
@@ -5,20 +5,33 @@ module SIF
5
5
  module PersonalRepresenter
6
6
  include Virtus.model
7
7
 
8
- attribute :name, MODEL_COMMON::Name
9
- attribute :local_id, String
8
+ attribute :name, MODEL_COMMON::Name
9
+ attribute :local_id, String
10
10
  attribute :state_province_id, String
11
- attribute :electronic_ids, Array[MODEL_COMMON::ElectronicId]
12
- attribute :other_ids, Array[MODEL_COMMON::OtherId]
13
- attribute :other_names, String
14
- attribute :demographics, MODEL_COMMON::Demographics
15
- attribute :addresses, Array[MODEL_COMMON::Address]
16
- attribute :phone_numbers, Array[MODEL_COMMON::PhoneNumber]
17
- attribute :emails, Array[MODEL_COMMON::Email]
11
+ attribute :electronic_ids, Array[MODEL_COMMON::ElectronicId]
12
+ attribute :other_ids, Array[MODEL_COMMON::OtherId]
13
+ attribute :other_names, String
14
+ attribute :demographics, MODEL_COMMON::Demographics
15
+ attribute :addresses, Array[MODEL_COMMON::Address]
16
+ attribute :phone_numbers, Array[MODEL_COMMON::PhoneNumber]
17
+ attribute :emails, Array[MODEL_COMMON::Email]
18
+
19
+ def first_name
20
+ name && name.first_name
21
+ end
22
+
23
+ def last_name
24
+ name && name.last_name
25
+ end
26
+
27
+ def full_name
28
+ name && name.full_name
29
+ end
18
30
 
19
31
  def first_email
20
32
  emails.map{ |email| email.value.split(/[,;\s]\s?/) }.flatten.first
21
33
  end
34
+
22
35
  def email
23
36
  first_email
24
37
  end
@@ -24,6 +24,18 @@ module SIF
24
24
  si.term_info_ref_id == term_info_ref_id
25
25
  end || Common::ScheduleInfo.new
26
26
  end
27
+
28
+ def first_schedule_info
29
+ schedule_infos.first || Common::ScheduleInfo.new
30
+ end
31
+
32
+ def term_info_ref_id
33
+ first_schedule_info.term_info_ref_id
34
+ end
35
+
36
+ def teacher
37
+ first_schedule_info.first_teacher
38
+ end
27
39
  end
28
40
  end
29
41
  end
@@ -14,6 +14,7 @@ describe SIF::Representation::Infra::Common::Message do
14
14
  end
15
15
 
16
16
  it "converts to json" do
17
+ rep
17
18
  rep.to_json
18
19
  end
19
20
 
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.8
4
+ version: 0.8.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -11,7 +11,7 @@ authors:
11
11
  autorequire:
12
12
  bindir: bin
13
13
  cert_chain: []
14
- date: 2013-12-04 00:00:00.000000000 Z
14
+ date: 2013-12-11 00:00:00.000000000 Z
15
15
  dependencies:
16
16
  - !ruby/object:Gem::Dependency
17
17
  name: rake