Class: LearnSprout::Teacher

Inherits:
Object
  • Object
show all
Defined in:
lib/learnsprout/teacher.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#addressObject

Returns the value of attribute address.



4
5
6
# File 'lib/learnsprout/teacher.rb', line 4

def address
  @address
end

#emailObject

Returns the value of attribute email.



4
5
6
# File 'lib/learnsprout/teacher.rb', line 4

def email
  @email
end

#first_nameObject

Returns the value of attribute first_name.



4
5
6
# File 'lib/learnsprout/teacher.rb', line 4

def first_name
  @first_name
end

#last_nameObject

Returns the value of attribute last_name.



4
5
6
# File 'lib/learnsprout/teacher.rb', line 4

def last_name
  @last_name
end

#middle_nameObject

Returns the value of attribute middle_name.



4
5
6
# File 'lib/learnsprout/teacher.rb', line 4

def middle_name
  @middle_name
end

#numberObject

Returns the value of attribute number.



4
5
6
# File 'lib/learnsprout/teacher.rb', line 4

def number
  @number
end

#phoneObject

Returns the value of attribute phone.



4
5
6
# File 'lib/learnsprout/teacher.rb', line 4

def phone
  @phone
end

#school_idObject

Returns the value of attribute school_id.



4
5
6
# File 'lib/learnsprout/teacher.rb', line 4

def school_id
  @school_id
end

#teacher_idObject

Returns the value of attribute teacher_id.



4
5
6
# File 'lib/learnsprout/teacher.rb', line 4

def teacher_id
  @teacher_id
end

#time_updatedObject

Returns the value of attribute time_updated.



4
5
6
# File 'lib/learnsprout/teacher.rb', line 4

def time_updated
  @time_updated
end

#titleObject

Returns the value of attribute title.



4
5
6
# File 'lib/learnsprout/teacher.rb', line 4

def title
  @title
end

Instance Method Details

#schoolObject



32
33
34
# File 'lib/learnsprout/teacher.rb', line 32

def school
    @school_id && @client.school(@org_id, @school_id)
end