Class: Teacher

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

Constant Summary collapse

'teachers'

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) ⇒ Teacher

Returns a new instance of Teacher.



13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/Appolo/Models/main_model/teacher.rb', line 13

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)

  @number = json_data[ModelUtils::NUMBER]
  @name = json_data[ModelUtils::NAME]
  @academic_email = json_data[ModelUtils::ACADEMIC_EMAIL]
  @avatar_url = AvatarUrl.new(json_data[ModelUtils::AVATAR_URL])
end

Instance Attribute Details

#academic_emailObject (readonly)

Returns the value of attribute academic_email.



10
11
12
# File 'lib/Appolo/Models/main_model/teacher.rb', line 10

def academic_email
  @academic_email
end

#avatar_urlObject (readonly)

Returns the value of attribute avatar_url.



10
11
12
# File 'lib/Appolo/Models/main_model/teacher.rb', line 10

def avatar_url
  @avatar_url
end

#nameObject (readonly)

Returns the value of attribute name.



10
11
12
# File 'lib/Appolo/Models/main_model/teacher.rb', line 10

def name
  @name
end

#numberObject (readonly)

Returns the value of attribute number.



10
11
12
# File 'lib/Appolo/Models/main_model/teacher.rb', line 10

def number
  @number
end

Instance Method Details

#to_sObject



27
28
29
# File 'lib/Appolo/Models/main_model/teacher.rb', line 27

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