Class: MaxipagoApi::CustomerModel
- Inherits:
-
Object
- Object
- MaxipagoApi::CustomerModel
- Defined in:
- lib/maxipago_api/models/customer_model.rb
Instance Attribute Summary collapse
-
#address1 ⇒ Object
Returns the value of attribute address1.
-
#address2 ⇒ Object
Returns the value of attribute address2.
-
#birth_date ⇒ Object
Returns the value of attribute birth_date.
-
#city ⇒ Object
Returns the value of attribute city.
-
#country ⇒ Object
Returns the value of attribute country.
-
#customer_id_ext ⇒ Object
Returns the value of attribute customer_id_ext.
-
#document ⇒ Object
Returns the value of attribute document.
-
#email ⇒ Object
Returns the value of attribute email.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#id ⇒ Object
Returns the value of attribute id.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#phone ⇒ Object
Returns the value of attribute phone.
-
#response_error ⇒ Object
Returns the value of attribute response_error.
-
#sex ⇒ Object
Returns the value of attribute sex.
-
#state ⇒ Object
Returns the value of attribute state.
-
#zipcode ⇒ Object
Returns the value of attribute zipcode.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ CustomerModel
constructor
A new instance of CustomerModel.
- #save ⇒ Object
- #to_object ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ CustomerModel
Returns a new instance of CustomerModel.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/maxipago_api/models/customer_model.rb', line 8 def initialize( = {}) self.customer_id_ext = [:customer_id_ext] self.first_name = [:first_name] self.last_name = [:last_name] self.zipcode = [:zipcode] self.email = [:email] self.birth_date = [:birth_date] self.document = [:document] self.sex = [:sex] self.address1 = [:address1] self.address2 = [:address2] self.city = [:city] self.state = [:state] self.zipcode = [:zipcode] self.country = [:country] self.phone = [:phone] self.email = [:email] end |
Instance Attribute Details
#address1 ⇒ Object
Returns the value of attribute address1.
4 5 6 |
# File 'lib/maxipago_api/models/customer_model.rb', line 4 def address1 @address1 end |
#address2 ⇒ Object
Returns the value of attribute address2.
4 5 6 |
# File 'lib/maxipago_api/models/customer_model.rb', line 4 def address2 @address2 end |
#birth_date ⇒ Object
Returns the value of attribute birth_date.
4 5 6 |
# File 'lib/maxipago_api/models/customer_model.rb', line 4 def birth_date @birth_date end |
#city ⇒ Object
Returns the value of attribute city.
4 5 6 |
# File 'lib/maxipago_api/models/customer_model.rb', line 4 def city @city end |
#country ⇒ Object
Returns the value of attribute country.
4 5 6 |
# File 'lib/maxipago_api/models/customer_model.rb', line 4 def country @country end |
#customer_id_ext ⇒ Object
Returns the value of attribute customer_id_ext.
4 5 6 |
# File 'lib/maxipago_api/models/customer_model.rb', line 4 def customer_id_ext @customer_id_ext end |
#document ⇒ Object
Returns the value of attribute document.
4 5 6 |
# File 'lib/maxipago_api/models/customer_model.rb', line 4 def document @document end |
#email ⇒ Object
Returns the value of attribute email.
4 5 6 |
# File 'lib/maxipago_api/models/customer_model.rb', line 4 def email @email end |
#first_name ⇒ Object
Returns the value of attribute first_name.
4 5 6 |
# File 'lib/maxipago_api/models/customer_model.rb', line 4 def first_name @first_name end |
#id ⇒ Object
Returns the value of attribute id.
4 5 6 |
# File 'lib/maxipago_api/models/customer_model.rb', line 4 def id @id end |
#last_name ⇒ Object
Returns the value of attribute last_name.
4 5 6 |
# File 'lib/maxipago_api/models/customer_model.rb', line 4 def last_name @last_name end |
#phone ⇒ Object
Returns the value of attribute phone.
4 5 6 |
# File 'lib/maxipago_api/models/customer_model.rb', line 4 def phone @phone end |
#response_error ⇒ Object
Returns the value of attribute response_error.
4 5 6 |
# File 'lib/maxipago_api/models/customer_model.rb', line 4 def response_error @response_error end |
#sex ⇒ Object
Returns the value of attribute sex.
4 5 6 |
# File 'lib/maxipago_api/models/customer_model.rb', line 4 def sex @sex end |
#state ⇒ Object
Returns the value of attribute state.
4 5 6 |
# File 'lib/maxipago_api/models/customer_model.rb', line 4 def state @state end |
#zipcode ⇒ Object
Returns the value of attribute zipcode.
4 5 6 |
# File 'lib/maxipago_api/models/customer_model.rb', line 4 def zipcode @zipcode end |
Class Method Details
.find(id) ⇒ Object
31 32 33 |
# File 'lib/maxipago_api/models/customer_model.rb', line 31 def self.find(id) MaxipagoApi::CustomerRequest.find(id) end |
Instance Method Details
#save ⇒ Object
27 28 29 |
# File 'lib/maxipago_api/models/customer_model.rb', line 27 def save MaxipagoApi::CustomerRequest.create(self) end |
#to_object ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/maxipago_api/models/customer_model.rb', line 35 def to_object { customerIdExt: self.customer_id_ext, firstName: self.first_name, lastName: self.last_name, zip: self.zipcode, email: self.email, dob: self.sex, ssn: self.document, sex: self.sex }.select{|k,v| v.present?} end |