Class: Bcash::Api::AccountCreationRequest
- Inherits:
-
BaseRequest
- Object
- BaseRequest
- Bcash::Api::AccountCreationRequest
- Defined in:
- lib/bcash/api/request/account_creation_request.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
Returns the value of attribute address.
-
#contact ⇒ Object
Returns the value of attribute contact.
-
#legal_person ⇒ Object
(also: #legalPerson)
Returns the value of attribute legal_person.
-
#owner ⇒ Object
Returns the value of attribute owner.
-
#transaction_mode ⇒ Object
(also: #transactionMode)
Returns the value of attribute transaction_mode.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
- #attributes ⇒ Object
- #errors_full_messages ⇒ Object
-
#initialize(attributes = {}) ⇒ AccountCreationRequest
constructor
A new instance of AccountCreationRequest.
- #legal_person_valid? ⇒ Boolean
- #valid? ⇒ Boolean
Constructor Details
#initialize(attributes = {}) ⇒ AccountCreationRequest
Returns a new instance of AccountCreationRequest.
10 11 12 13 14 |
# File 'lib/bcash/api/request/account_creation_request.rb', line 10 def initialize(attributes={}) @address = AddressRequest.new(attributes.delete(:address)) @owner = PersonRequest.new(attributes.delete(:owner)) @contact = ContactRequest.new(attributes.delete(:contact)) end |
Instance Attribute Details
#address ⇒ Object
Returns the value of attribute address.
3 4 5 |
# File 'lib/bcash/api/request/account_creation_request.rb', line 3 def address @address end |
#contact ⇒ Object
Returns the value of attribute contact.
3 4 5 |
# File 'lib/bcash/api/request/account_creation_request.rb', line 3 def contact @contact end |
#legal_person ⇒ Object Also known as: legalPerson
Returns the value of attribute legal_person.
3 4 5 |
# File 'lib/bcash/api/request/account_creation_request.rb', line 3 def legal_person @legal_person end |
#owner ⇒ Object
Returns the value of attribute owner.
3 4 5 |
# File 'lib/bcash/api/request/account_creation_request.rb', line 3 def owner @owner end |
#transaction_mode ⇒ Object Also known as: transactionMode
Returns the value of attribute transaction_mode.
3 4 5 |
# File 'lib/bcash/api/request/account_creation_request.rb', line 3 def transaction_mode @transaction_mode end |
#url ⇒ Object
Returns the value of attribute url.
3 4 5 |
# File 'lib/bcash/api/request/account_creation_request.rb', line 3 def url @url end |
Instance Method Details
#attributes ⇒ Object
29 30 31 |
# File 'lib/bcash/api/request/account_creation_request.rb', line 29 def attributes { 'owner' => owner, 'legalPerson' => legal_person, 'address' => address, 'contact' => contact, 'url' => url, 'transactionMode' => transaction_mode } end |
#errors_full_messages ⇒ Object
24 25 26 27 |
# File 'lib/bcash/api/request/account_creation_request.rb', line 24 def errors. + address.errors. + owner.errors. + contact.errors. end |
#legal_person_valid? ⇒ Boolean
20 21 22 |
# File 'lib/bcash/api/request/account_creation_request.rb', line 20 def legal_person_valid? legal_person.present? ? legal_person.valid? : true end |
#valid? ⇒ Boolean
16 17 18 |
# File 'lib/bcash/api/request/account_creation_request.rb', line 16 def valid? super && owner.valid? && address.valid? && contact.valid? && legal_person_valid? end |