Class: KondutoCustomer
- Inherits:
-
Object
- Object
- KondutoCustomer
- Defined in:
- lib/konduto-ruby/konduto_customer.rb
Instance Attribute Summary collapse
-
#created_at ⇒ Object
Returns the value of attribute created_at.
-
#dob ⇒ Object
Returns the value of attribute dob.
-
#email ⇒ Object
Returns the value of attribute email.
-
#id ⇒ Object
Returns the value of attribute id.
-
#name ⇒ Object
Returns the value of attribute name.
-
#new ⇒ Object
Returns the value of attribute new.
-
#phone1 ⇒ Object
Returns the value of attribute phone1.
-
#phone2 ⇒ Object
Returns the value of attribute phone2.
-
#tax_id ⇒ Object
Returns the value of attribute tax_id.
-
#vip ⇒ Object
Returns the value of attribute vip.
Instance Method Summary collapse
-
#initialize(*args) ⇒ KondutoCustomer
constructor
A new instance of KondutoCustomer.
- #to_hash ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize(*args) ⇒ KondutoCustomer
Returns a new instance of KondutoCustomer.
4 5 6 7 8 9 10 |
# File 'lib/konduto-ruby/konduto_customer.rb', line 4 def initialize(*args) unless args[0].nil? args[0].each do |k,v| instance_variable_set("@#{k}", v) unless v.nil? end end end |
Instance Attribute Details
#created_at ⇒ Object
Returns the value of attribute created_at.
2 3 4 |
# File 'lib/konduto-ruby/konduto_customer.rb', line 2 def created_at @created_at end |
#dob ⇒ Object
Returns the value of attribute dob.
2 3 4 |
# File 'lib/konduto-ruby/konduto_customer.rb', line 2 def dob @dob end |
#email ⇒ Object
Returns the value of attribute email.
2 3 4 |
# File 'lib/konduto-ruby/konduto_customer.rb', line 2 def email @email end |
#id ⇒ Object
Returns the value of attribute id.
2 3 4 |
# File 'lib/konduto-ruby/konduto_customer.rb', line 2 def id @id end |
#name ⇒ Object
Returns the value of attribute name.
2 3 4 |
# File 'lib/konduto-ruby/konduto_customer.rb', line 2 def name @name end |
#new ⇒ Object
Returns the value of attribute new.
2 3 4 |
# File 'lib/konduto-ruby/konduto_customer.rb', line 2 def new @new end |
#phone1 ⇒ Object
Returns the value of attribute phone1.
2 3 4 |
# File 'lib/konduto-ruby/konduto_customer.rb', line 2 def phone1 @phone1 end |
#phone2 ⇒ Object
Returns the value of attribute phone2.
2 3 4 |
# File 'lib/konduto-ruby/konduto_customer.rb', line 2 def phone2 @phone2 end |
#tax_id ⇒ Object
Returns the value of attribute tax_id.
2 3 4 |
# File 'lib/konduto-ruby/konduto_customer.rb', line 2 def tax_id @tax_id end |
#vip ⇒ Object
Returns the value of attribute vip.
2 3 4 |
# File 'lib/konduto-ruby/konduto_customer.rb', line 2 def vip @vip end |
Instance Method Details
#to_hash ⇒ Object
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 |
# File 'lib/konduto-ruby/konduto_customer.rb', line 12 def to_hash hash = { id: self.id, name: self.name, email: self.email, dob: self.dob, tax_id: self.tax_id, phone1: self.phone1, phone2: self.phone2, created_at: self.created_at, new: self.new, vip: self.vip } KondutoUtils.remove_nil_keys_from_hash(hash) end |
#to_json ⇒ Object
28 29 30 |
# File 'lib/konduto-ruby/konduto_customer.rb', line 28 def to_json self.to_hash.to_json end |