Class: Program
- Defined in:
- lib/Appolo/Models/main_model/program.rb
Constant Summary collapse
- @@type_for_links =
'programs'
Instance Attribute Summary collapse
-
#course_units ⇒ Object
readonly
Returns the value of attribute course_units.
-
#full_name ⇒ Object
readonly
Returns the value of attribute full_name.
Attributes inherited from Element
Instance Method Summary collapse
-
#initialize(data) ⇒ Program
constructor
A new instance of Program.
- #to_s ⇒ Object
Constructor Details
#initialize(data) ⇒ Program
Returns a new instance of Program.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/Appolo/Models/main_model/program.rb', line 11 def initialize(data) json_data = ModelUtils::check_json_info data super(json_data[ModelUtils::ID], json_data[ModelUtils::SHORT_NAME], json_data[ModelUtils::LINKS], @@type_for_links) @full_name = (json_data[ModelUtils::FULL_NAME] || json_data[ModelUtils::NAME]) @course_units = get_course_units json_data[ModelUtils::COURSE_UNIT] end |
Instance Attribute Details
#course_units ⇒ Object (readonly)
Returns the value of attribute course_units.
7 8 9 |
# File 'lib/Appolo/Models/main_model/program.rb', line 7 def course_units @course_units end |
#full_name ⇒ Object (readonly)
Returns the value of attribute full_name.
7 8 9 |
# File 'lib/Appolo/Models/main_model/program.rb', line 7 def full_name @full_name end |
Instance Method Details
#to_s ⇒ Object
24 25 26 |
# File 'lib/Appolo/Models/main_model/program.rb', line 24 def to_s "#{@id} - #{@full_name}" end |