Class: Blackbaud::AcademicYear

Inherits:
BlackbaudObject show all
Defined in:
lib/blackbaud-client/api/academic_year.rb

Instance Attribute Summary collapse

Attributes inherited from BlackbaudObject

#client

Instance Method Summary collapse

Methods inherited from BlackbaudObject

#format_date, #to_hash, #to_json

Constructor Details

#initialize(options) ⇒ AcademicYear



5
6
7
8
9
10
11
12
13
14
15
# File 'lib/blackbaud-client/api/academic_year.rb', line 5

def initialize(options)

  options.fetch(:values)["sessions"].map! {|s| Blackbaud::Session.new(values: s)} if options.fetch(:values)["sessions"]

  ["start_date", "end_date"].each do |date|
    send("#{date}=".intern, format_date(options.fetch(:values)["#{date}"]))
    options.fetch(:values).delete("#{date}")
  end

  super
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



3
4
5
# File 'lib/blackbaud-client/api/academic_year.rb', line 3

def description
  @description
end

#ea7_academic_year_idObject

Returns the value of attribute ea7_academic_year_id.



3
4
5
# File 'lib/blackbaud-client/api/academic_year.rb', line 3

def ea7_academic_year_id
  @ea7_academic_year_id
end

#end_dateObject

Returns the value of attribute end_date.



3
4
5
# File 'lib/blackbaud-client/api/academic_year.rb', line 3

def end_date
  @end_date
end

Returns the value of attribute links.



3
4
5
# File 'lib/blackbaud-client/api/academic_year.rb', line 3

def links
  @links
end

#school_idObject

Returns the value of attribute school_id.



3
4
5
# File 'lib/blackbaud-client/api/academic_year.rb', line 3

def school_id
  @school_id
end

#school_nameObject

Returns the value of attribute school_name.



3
4
5
# File 'lib/blackbaud-client/api/academic_year.rb', line 3

def school_name
  @school_name
end

#sessionsObject

Returns the value of attribute sessions.



3
4
5
# File 'lib/blackbaud-client/api/academic_year.rb', line 3

def sessions
  @sessions
end

#short_descriptionObject

Returns the value of attribute short_description.



3
4
5
# File 'lib/blackbaud-client/api/academic_year.rb', line 3

def short_description
  @short_description
end

#start_dateObject

Returns the value of attribute start_date.



3
4
5
# File 'lib/blackbaud-client/api/academic_year.rb', line 3

def start_date
  @start_date
end

Instance Method Details

#connection_stringObject



17
18
19
# File 'lib/blackbaud-client/api/academic_year.rb', line 17

def connection_string
  "academic_years/#{self.ea7_academic_year_id}"
end

#termsObject



21
22
23
# File 'lib/blackbaud-client/api/academic_year.rb', line 21

def terms
  self.sessions.inject([]) {|r, s| r + s.terms}
end