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.
838 839 840 841 842 |
# File 'lib/webpay/data_types.rb', line 838 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.
821 822 823 |
# File 'lib/webpay/data_types.rb', line 821 def attributes @attributes end |
Class Method Details
.create(params) ⇒ Object
828 829 830 831 832 833 834 835 836 |
# File 'lib/webpay/data_types.rb', line 828 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
823 824 825 |
# File 'lib/webpay/data_types.rb', line 823 def self.fields ['card', 'description', 'email', 'uuid'] end |
Instance Method Details
#card ⇒ Object
attributes accessors
861 862 863 |
# File 'lib/webpay/data_types.rb', line 861 def card attributes['card'] end |
#card=(value) ⇒ Object
865 866 867 868 |
# File 'lib/webpay/data_types.rb', line 865 def card=(value) value = value.is_a?(Hash) ? WebPay::CardRequest.new(value) : value attributes['card'] = value end |
#description ⇒ Object
870 871 872 |
# File 'lib/webpay/data_types.rb', line 870 def description attributes['description'] end |
#description=(value) ⇒ Object
874 875 876 |
# File 'lib/webpay/data_types.rb', line 874 def description=(value) attributes['description'] = value end |
#email ⇒ Object
878 879 880 |
# File 'lib/webpay/data_types.rb', line 878 def email attributes['email'] end |
#email=(value) ⇒ Object
882 883 884 |
# File 'lib/webpay/data_types.rb', line 882 def email=(value) attributes['email'] = value end |
#query_params ⇒ Object
854 855 856 857 |
# File 'lib/webpay/data_types.rb', line 854 def query_params result = {} return result end |
#request_body ⇒ Object
845 846 847 848 849 850 851 852 |
# File 'lib/webpay/data_types.rb', line 845 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
886 887 888 |
# File 'lib/webpay/data_types.rb', line 886 def uuid attributes['uuid'] end |
#uuid=(value) ⇒ Object
890 891 892 |
# File 'lib/webpay/data_types.rb', line 890 def uuid=(value) attributes['uuid'] = value end |