Class: Program

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

Constant Summary collapse

TYPE =
'programs'

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(program_json_struct, links_tpe = TYPE) ⇒ Program

Returns a new instance of Program.


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

def initialize(program_json_struct, links_tpe=TYPE)
    @id = program_json_struct[ModelUtils::ID]
    @short_name = program_json_struct[ModelUtils::SHORT_NAME]
    @links = Links.new(program_json_struct[ModelUtils::LINKS], links_tpe)
    @full_name = program_json_struct[ModelUtils::FULL_NAME]
end

Instance Attribute Details

#full_nameObject (readonly)

Returns the value of attribute full_name


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

def full_name
  @full_name
end

#idObject (readonly)

Returns the value of attribute id


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

def id
  @id
end

Returns the value of attribute links


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

def links
  @links
end

#short_nameObject (readonly)

Returns the value of attribute short_name


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

def short_name
  @short_name
end

Instance Method Details

#to_sObject


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

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