Class: LearnSprout::Teacher
- Inherits:
-
Object
- Object
- LearnSprout::Teacher
- Defined in:
- lib/learnsprout/teacher.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#email ⇒ Object
Returns the value of attribute email.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#middle_name ⇒ Object
Returns the value of attribute middle_name.
-
#number ⇒ Object
Returns the value of attribute number.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#school_id ⇒ Object
Returns the value of attribute school_id.
-
#teacher_id ⇒ Object
Returns the value of attribute teacher_id.
-
#time_updated ⇒ Object
Returns the value of attribute time_updated.
-
#title ⇒ Object
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Teacher
constructor
A new instance of Teacher.
- #school ⇒ Object
Constructor Details
#initialize(attrs = {}) ⇒ Teacher
Returns a new instance of Teacher.
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/learnsprout/teacher.rb', line 16 def initialize(attrs={}) @client = attrs["client"] @org_id = attrs["org_id"] @teacher_id = attrs["id"] @first_name = attrs["first_name"] @middle_name = attrs["middle_name"] @last_name = attrs["last_name"] @title = attrs["title"] @address = attrs["address"] && Address.new(attrs["address"]) @school_id = attrs["school"] && attrs["school"]["id"] @number = attrs["number"] @phone = attrs["phone"] && Phone.new(attrs["phone"]) @time_updated = attrs["time_updated"] @email = attrs["email"] end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
4 5 6 |
# File 'lib/learnsprout/teacher.rb', line 4 def address @address end |
#email ⇒ Object
Returns the value of attribute email.
4 5 6 |
# File 'lib/learnsprout/teacher.rb', line 4 def email @email end |
#first_name ⇒ Object
Returns the value of attribute first_name.
4 5 6 |
# File 'lib/learnsprout/teacher.rb', line 4 def first_name @first_name end |
#last_name ⇒ Object
Returns the value of attribute last_name.
4 5 6 |
# File 'lib/learnsprout/teacher.rb', line 4 def last_name @last_name end |
#middle_name ⇒ Object
Returns the value of attribute middle_name.
4 5 6 |
# File 'lib/learnsprout/teacher.rb', line 4 def middle_name @middle_name end |
#number ⇒ Object
Returns the value of attribute number.
4 5 6 |
# File 'lib/learnsprout/teacher.rb', line 4 def number @number end |
#phone ⇒ Object
Returns the value of attribute phone.
4 5 6 |
# File 'lib/learnsprout/teacher.rb', line 4 def phone @phone end |
#school_id ⇒ Object
Returns the value of attribute school_id.
4 5 6 |
# File 'lib/learnsprout/teacher.rb', line 4 def school_id @school_id end |
#teacher_id ⇒ Object
Returns the value of attribute teacher_id.
4 5 6 |
# File 'lib/learnsprout/teacher.rb', line 4 def teacher_id @teacher_id end |
#time_updated ⇒ Object
Returns the value of attribute time_updated.
4 5 6 |
# File 'lib/learnsprout/teacher.rb', line 4 def time_updated @time_updated end |
#title ⇒ Object
Returns the value of attribute title.
4 5 6 |
# File 'lib/learnsprout/teacher.rb', line 4 def title @title end |
Instance Method Details
#school ⇒ Object
32 33 34 |
# File 'lib/learnsprout/teacher.rb', line 32 def school @school_id && @client.school(@org_id, @school_id) end |