Class: CourseUnit

Inherits:
Element show all
Defined in:
lib/Appolo/Models/main_model/courses.rb

Constant Summary collapse

'courseunits'

Instance Attribute Summary collapse

Attributes inherited from Element

#id, #links, #short_name

Instance Method Summary collapse

Methods inherited from Element

#check_json_info

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

#nameObject (readonly)

Returns the value of attribute name.



8
9
10
# File 'lib/Appolo/Models/main_model/courses.rb', line 8

def name
  @name
end

#programsObject (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_sObject



23
24
25
# File 'lib/Appolo/Models/main_model/courses.rb', line 23

def to_s
  "#{@id} - #{@short_name}"
end