Class: LearnSprout::Student
- Inherits:
-
Object
- Object
- LearnSprout::Student
- Defined in:
- lib/learnsprout/student.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#birthday ⇒ Object
Returns the value of attribute birthday.
-
#entry_date ⇒ Object
Returns the value of attribute entry_date.
-
#exit_date ⇒ Object
Returns the value of attribute exit_date.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#gender ⇒ Object
Returns the value of attribute gender.
-
#grade ⇒ Object
Returns the value of attribute grade.
-
#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.
-
#student_id ⇒ Object
Returns the value of attribute student_id.
-
#time_updated ⇒ Object
Returns the value of attribute time_updated.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Student
constructor
A new instance of Student.
Constructor Details
#initialize(attrs = {}) ⇒ Student
Returns a new instance of Student.
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/learnsprout/student.rb', line 19 def initialize(attrs={}) @client = attrs["client"] @org_id = attrs["org_id"] @student_id = attrs["id"] @last_name = attrs["last_name"] @grade = attrs["grade"] @address = Address.new(attrs["address"]) @school_id = attrs["school"]["id"] @number = attrs["number"] @phone = Phone.new(attrs["phone"]) @birthday = attrs["birthday"] && Date.parse(attrs["birthday"]) @first_name = attrs["first_name"] @time_updated = attrs["time_updated"] @middle_name = attrs["middle_name"] @gender = attrs["gender"] @exit_date = attrs["exit_date"] && Date.parse(attrs["exit_date"]) @entry_date = attrs["entry_date"] && Date.parse(attrs["entry_date"]) end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
4 5 6 |
# File 'lib/learnsprout/student.rb', line 4 def address @address end |
#birthday ⇒ Object
Returns the value of attribute birthday.
4 5 6 |
# File 'lib/learnsprout/student.rb', line 4 def birthday @birthday end |
#entry_date ⇒ Object
Returns the value of attribute entry_date.
4 5 6 |
# File 'lib/learnsprout/student.rb', line 4 def entry_date @entry_date end |
#exit_date ⇒ Object
Returns the value of attribute exit_date.
4 5 6 |
# File 'lib/learnsprout/student.rb', line 4 def exit_date @exit_date end |
#first_name ⇒ Object
Returns the value of attribute first_name.
4 5 6 |
# File 'lib/learnsprout/student.rb', line 4 def first_name @first_name end |
#gender ⇒ Object
Returns the value of attribute gender.
4 5 6 |
# File 'lib/learnsprout/student.rb', line 4 def gender @gender end |
#grade ⇒ Object
Returns the value of attribute grade.
4 5 6 |
# File 'lib/learnsprout/student.rb', line 4 def grade @grade end |
#last_name ⇒ Object
Returns the value of attribute last_name.
4 5 6 |
# File 'lib/learnsprout/student.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/student.rb', line 4 def middle_name @middle_name end |
#number ⇒ Object
Returns the value of attribute number.
4 5 6 |
# File 'lib/learnsprout/student.rb', line 4 def number @number end |
#phone ⇒ Object
Returns the value of attribute phone.
4 5 6 |
# File 'lib/learnsprout/student.rb', line 4 def phone @phone end |
#school_id ⇒ Object
Returns the value of attribute school_id.
4 5 6 |
# File 'lib/learnsprout/student.rb', line 4 def school_id @school_id end |
#student_id ⇒ Object
Returns the value of attribute student_id.
4 5 6 |
# File 'lib/learnsprout/student.rb', line 4 def student_id @student_id end |
#time_updated ⇒ Object
Returns the value of attribute time_updated.
4 5 6 |
# File 'lib/learnsprout/student.rb', line 4 def time_updated @time_updated end |