Class: Manabu::Guardian

Inherits:
Resource show all
Defined in:
lib/manabu/guardian.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Resource

#_fill, #initialize, #to_hash

Constructor Details

This class inherits a constructor from Manabu::Resource

Instance Attribute Details

#birth_dateObject

Returns the value of attribute birth_date.



5
6
7
# File 'lib/manabu/guardian.rb', line 5

def birth_date
  @birth_date
end

#genderObject

Returns the value of attribute gender.



5
6
7
# File 'lib/manabu/guardian.rb', line 5

def gender
  @gender
end

#idObject

Returns the value of attribute id.



5
6
7
# File 'lib/manabu/guardian.rb', line 5

def id
  @id
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/manabu/guardian.rb', line 5

def name
  @name
end

#name_readingObject

Returns the value of attribute name_reading.



5
6
7
# File 'lib/manabu/guardian.rb', line 5

def name_reading
  @name_reading
end

#surnameObject

Returns the value of attribute surname.



5
6
7
# File 'lib/manabu/guardian.rb', line 5

def surname
  @surname
end

#surname_readingObject

Returns the value of attribute surname_reading.



5
6
7
# File 'lib/manabu/guardian.rb', line 5

def surname_reading
  @surname_reading
end

Instance Method Details

#fill(**info) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/manabu/guardian.rb', line 7

def fill(**info)
  @id = info.fetch(:id, @id)
  @surname = info.fetch(:surname, @surname)
  @name = info.fetch(:name, @name)
  @name_reading = info.fetch(:name_reading, @name_reading)
  @surname_reading = info.fetch(:surname_reading, @surname_reading)
  @birth_date = info.fetch(:birth_date, @birth_date)
  @gender = info.fetch(:gender, @gender)

  self
end