Class: Supai::Person
- Defined in:
- lib/supai/person.rb,
lib/supai/customer.rb
Instance Attribute Summary collapse
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Person
constructor
A new instance of Person.
Methods inherited from Resource
#as_json, attr_accessor, attr_collections, attr_objects, attr_timestamp_accessor, attributes, #inspect, #parse_collection, #parse_object, #parse_timestamp, #set_attribute, #set_attributes, #underscore
Constructor Details
#initialize(hash) ⇒ Person
Returns a new instance of Person.
9 10 11 12 |
# File 'lib/supai/person.rb', line 9 def initialize(hash) set_attributes(hash) @name ||= [first_name, last_name].join(" ") end |
Instance Attribute Details
#first_name ⇒ Object
Returns the value of attribute first_name.
3 4 5 |
# File 'lib/supai/person.rb', line 3 def first_name @first_name end |
#last_name ⇒ Object
Returns the value of attribute last_name.
3 4 5 |
# File 'lib/supai/person.rb', line 3 def last_name @last_name end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/supai/person.rb', line 5 def name @name end |