Class: LectiveSemester

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

Constant Summary collapse

'lectiveSemesters'

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_str) ⇒ LectiveSemester

Returns a new instance of LectiveSemester.



11
12
13
14
15
16
17
18
19
20
21
# File 'lib/Appolo/Models/main_model/lective_semester.rb', line 11

def initialize(json_str)
  json_data = check_json_info json_str

  super(json_data[ModelUtils::LECTIVE_ID],
        json_data[ModelUtils::SHORT_NAME],
        json_data[ModelUtils::LINKS],
        @@type_of_links)
  @start_year = json_data[ModelUtils::START_YEAR]
  @term = json_data[ModelUtils::TERM]
  @term_name = json_data[ModelUtils::TERM_NAME]
end

Instance Attribute Details

#start_yearObject (readonly)

Returns the value of attribute start_year.



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

def start_year
  @start_year
end

#termObject (readonly)

Returns the value of attribute term.



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

def term
  @term
end

#term_nameObject (readonly)

Returns the value of attribute term_name.



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

def term_name
  @term_name
end

Instance Method Details

#to_sObject



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

def to_s
  "#{@id} - #{@short_name} : #{@term_name} #{@start_year}"
end