Class: WebPay::CustomerRequestCreate
- Defined in:
- lib/webpay/data_types.rb
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Class Method Summary collapse
Instance Method Summary collapse
-
#card ⇒ Object
attributes accessors.
- #card=(value) ⇒ Object
- #description ⇒ Object
- #description=(value) ⇒ Object
- #email ⇒ Object
- #email=(value) ⇒ Object
-
#initialize(hash = {}) ⇒ CustomerRequestCreate
constructor
A new instance of CustomerRequestCreate.
- #query_params ⇒ Object
- #request_body ⇒ Object
- #uuid ⇒ Object
- #uuid=(value) ⇒ Object
Methods inherited from Entity
Constructor Details
#initialize(hash = {}) ⇒ CustomerRequestCreate
Returns a new instance of CustomerRequestCreate.
755 756 757 758 759 |
# File 'lib/webpay/data_types.rb', line 755 def initialize(hash = {}) hash = normalize_hash(hash) hash['card'] = hash['card'].is_a?(Hash) ? WebPay::CardRequest.new(hash['card']) : hash['card'] @attributes = hash end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
738 739 740 |
# File 'lib/webpay/data_types.rb', line 738 def attributes @attributes end |
Class Method Details
.create(params) ⇒ Object
745 746 747 748 749 750 751 752 753 |
# File 'lib/webpay/data_types.rb', line 745 def self.create(params) return params if params.is_a?(self) hash = case params when Hash; params else raise WebPay::InvalidRequestError.new("#{self} does not accept the given value", params) end self.new(hash) end |
.fields ⇒ Object
740 741 742 |
# File 'lib/webpay/data_types.rb', line 740 def self.fields ['card', 'description', 'email', 'uuid'] end |
Instance Method Details
#card ⇒ Object
attributes accessors
778 779 780 |
# File 'lib/webpay/data_types.rb', line 778 def card attributes['card'] end |
#card=(value) ⇒ Object
782 783 784 785 |
# File 'lib/webpay/data_types.rb', line 782 def card=(value) value = value.is_a?(Hash) ? WebPay::CardRequest.new(value) : value attributes['card'] = value end |
#description ⇒ Object
787 788 789 |
# File 'lib/webpay/data_types.rb', line 787 def description attributes['description'] end |
#description=(value) ⇒ Object
791 792 793 |
# File 'lib/webpay/data_types.rb', line 791 def description=(value) attributes['description'] = value end |
#email ⇒ Object
795 796 797 |
# File 'lib/webpay/data_types.rb', line 795 def email attributes['email'] end |
#email=(value) ⇒ Object
799 800 801 |
# File 'lib/webpay/data_types.rb', line 799 def email=(value) attributes['email'] = value end |
#query_params ⇒ Object
771 772 773 774 |
# File 'lib/webpay/data_types.rb', line 771 def query_params result = {} return result end |
#request_body ⇒ Object
762 763 764 765 766 767 768 769 |
# File 'lib/webpay/data_types.rb', line 762 def request_body result = {} copy_if_exists(@attributes, result, 'card', 'request_body'); copy_if_exists(@attributes, result, 'description', 'request_body'); copy_if_exists(@attributes, result, 'email', 'request_body'); copy_if_exists(@attributes, result, 'uuid', 'request_body'); result end |
#uuid ⇒ Object
803 804 805 |
# File 'lib/webpay/data_types.rb', line 803 def uuid attributes['uuid'] end |
#uuid=(value) ⇒ Object
807 808 809 |
# File 'lib/webpay/data_types.rb', line 807 def uuid=(value) attributes['uuid'] = value end |