Class: CourseUnit
- Defined in:
- lib/Appolo/Models/main_model/courses.rb
Constant Summary collapse
- @@type_of_links =
'courseunits'
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#programs ⇒ Object
readonly
Returns the value of attribute programs.
Attributes inherited from Element
Instance Method Summary collapse
-
#initialize(json_info) ⇒ CourseUnit
constructor
A new instance of CourseUnit.
- #to_s ⇒ Object
Methods inherited from Element
Constructor Details
#initialize(json_info) ⇒ CourseUnit
Returns a new instance of CourseUnit.
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/Appolo/Models/main_model/courses.rb', line 10 def initialize(json_info) json_data = check_json_info json_info super(json_data[ModelUtils::ID], json_data[ModelUtils::SHORT_NAME], json_data[ModelUtils::LINKS], @@type_of_links) @name = json_data[ModelUtils::FULL_NAME] || json_data[ModelUtils::NAME] #@programs = TODO end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
8 9 10 |
# File 'lib/Appolo/Models/main_model/courses.rb', line 8 def name @name end |
#programs ⇒ Object (readonly)
Returns the value of attribute programs.
8 9 10 |
# File 'lib/Appolo/Models/main_model/courses.rb', line 8 def programs @programs end |
Instance Method Details
#to_s ⇒ Object
23 24 25 |
# File 'lib/Appolo/Models/main_model/courses.rb', line 23 def to_s "#{@id} - #{@short_name}" end |