Class: LearnSprout::Student

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#addressObject

Returns the value of attribute address.



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

def address
  @address
end

#birthdayObject

Returns the value of attribute birthday.



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

def birthday
  @birthday
end

#entry_dateObject

Returns the value of attribute entry_date.



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

def 
  @entry_date
end

#exit_dateObject

Returns the value of attribute exit_date.



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

def exit_date
  @exit_date
end

#first_nameObject

Returns the value of attribute first_name.



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

def first_name
  @first_name
end

#genderObject

Returns the value of attribute gender.



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

def gender
  @gender
end

#gradeObject

Returns the value of attribute grade.



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

def grade
  @grade
end

#last_nameObject

Returns the value of attribute last_name.



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

def last_name
  @last_name
end

#middle_nameObject

Returns the value of attribute middle_name.



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

def middle_name
  @middle_name
end

#numberObject

Returns the value of attribute number.



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

def number
  @number
end

#phoneObject

Returns the value of attribute phone.



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

def phone
  @phone
end

#school_idObject

Returns the value of attribute school_id.



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

def school_id
  @school_id
end

#student_idObject

Returns the value of attribute student_id.



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

def student_id
  @student_id
end

#time_updatedObject

Returns the value of attribute time_updated.



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

def time_updated
  @time_updated
end