Class: Teacher
- Defined in:
- lib/Appolo/Models/main_model/teacher.rb
Constant Summary collapse
- @@type_of_links =
'teachers'
Instance Attribute Summary collapse
-
#academic_email ⇒ Object
readonly
Returns the value of attribute academic_email.
-
#avatar_url ⇒ Object
readonly
Returns the value of attribute avatar_url.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
Attributes inherited from Element
Instance Method Summary collapse
-
#initialize(json_info) ⇒ Teacher
constructor
A new instance of Teacher.
- #to_s ⇒ Object
Methods inherited from Element
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_email ⇒ Object (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_url ⇒ Object (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 |
#name ⇒ Object (readonly)
Returns the value of attribute name.
10 11 12 |
# File 'lib/Appolo/Models/main_model/teacher.rb', line 10 def name @name end |
#number ⇒ Object (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_s ⇒ Object
27 28 29 |
# File 'lib/Appolo/Models/main_model/teacher.rb', line 27 def to_s "#{@id} - #{@short_name} : #{@academic_email}" end |