Class: CourseUnit

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json_info) ⇒ CourseUnit


9
10
11
12
13
14
15
# File 'lib/Appolo/Models/main_model/courses.rb', line 9

def initialize(json_info)
    @id = json_info[ModelUtils::ID]
    @short_name = json_info[ModelUtils::SHORT_NAME]
    @name = json_info[ModelUtils::NAME]
    @links = Links.new json_info[ModelUtils::LINKS], TYPE    #@programs = TODO

end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id


6
7
8
# File 'lib/Appolo/Models/main_model/courses.rb', line 6

def id
  @id
end

Returns the value of attribute links


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

def links
  @links
end

#nameObject (readonly)

Returns the value of attribute name


6
7
8
# File 'lib/Appolo/Models/main_model/courses.rb', line 6

def name
  @name
end

#programsObject (readonly)

Returns the value of attribute programs


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

def programs
  @programs
end

#short_nameObject (readonly)

Returns the value of attribute short_name


6
7
8
# File 'lib/Appolo/Models/main_model/courses.rb', line 6

def short_name
  @short_name
end

Instance Method Details

#to_sObject


17
18
19
# File 'lib/Appolo/Models/main_model/courses.rb', line 17

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