Class: Supai::Person

Inherits:
Resource show all
Defined in:
lib/supai/person.rb,
lib/supai/customer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject

Returns the value of attribute first_name.



3
4
5
# File 'lib/supai/person.rb', line 3

def first_name
  @first_name
end

#last_nameObject

Returns the value of attribute last_name.



3
4
5
# File 'lib/supai/person.rb', line 3

def last_name
  @last_name
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/supai/person.rb', line 5

def name
  @name
end