Class: Upay::People::Buyer
Instance Method Summary
collapse
Methods inherited from Person
#contactPhone, #contactPhone=, #emailAddress, #emailAddress=, #fullName, #fullName=, #initialize
Instance Method Details
#dniNumber ⇒ Object
11
|
# File 'lib/upay/people/buyer.rb', line 11
def dniNumber; @dniNumber end
|
#dniNumber=(dniNumber = nil) ⇒ Object
12
|
# File 'lib/upay/people/buyer.rb', line 12
def dniNumber=(dniNumber = nil) @dniNumber = dniNumber; end
|
#id ⇒ Object
5
|
# File 'lib/upay/people/buyer.rb', line 5
def id; @id end
|
#id=(id = nil) ⇒ Object
6
|
# File 'lib/upay/people/buyer.rb', line 6
def id=(id = nil) @id = id; end
|
#merchantBuyerId ⇒ Object
8
|
# File 'lib/upay/people/buyer.rb', line 8
def merchantBuyerId; @merchantBuyerId || @id end
|
#merchantBuyerId=(merchantBuyerId = nil) ⇒ Object
9
|
# File 'lib/upay/people/buyer.rb', line 9
def merchantBuyerId=(merchantBuyerId = nil) @merchantBuyerId = merchantBuyerId; end
|
#shippingAddress ⇒ Object
14
|
# File 'lib/upay/people/buyer.rb', line 14
def shippingAddress; @shippingAddress end
|
#shippingAddress=(shippingAddress = nil) ⇒ Object
15
|
# File 'lib/upay/people/buyer.rb', line 15
def shippingAddress=(shippingAddress = nil) @shippingAddress = shippingAddress; end
|
#to_hash ⇒ Object
22
23
24
25
26
|
# File 'lib/upay/people/buyer.rb', line 22
def to_hash
person_hash = self.instance_variables.each_with_object({}) { |var,hash| hash[var.to_s.delete("@").to_sym] = self.instance_variable_get(var)}
person_hash[:shippingAddress] = self.shippingAddress.to_hash if self.shippingAddress
person_hash
end
|
#valid? ⇒ Boolean
17
18
19
20
|
# File 'lib/upay/people/buyer.rb', line 17
def valid?
validator = BuyerValidator.new
validator.valid?(self)
end
|