Class: Braintree::PayerInfoInput
- Inherits:
-
Object
- Object
- Braintree::PayerInfoInput
- Includes:
- BaseModule
- Defined in:
- lib/braintree/graphql/inputs/payer_info_input.rb
Instance Attribute Summary collapse
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
-
#billing_address ⇒ Object
readonly
Returns the value of attribute billing_address.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#given_name ⇒ Object
readonly
Returns the value of attribute given_name.
-
#phone_country_code ⇒ Object
readonly
Returns the value of attribute phone_country_code.
-
#phone_number ⇒ Object
readonly
Returns the value of attribute phone_number.
-
#shipping_address ⇒ Object
readonly
Returns the value of attribute shipping_address.
-
#surname ⇒ Object
readonly
Returns the value of attribute surname.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ PayerInfoInput
constructor
A new instance of PayerInfoInput.
- #inspect ⇒ Object
- #to_graphql_variables ⇒ Object
Methods included from BaseModule
Methods included from BaseModule::Methods
#copy_instance_variables_from_object, #return_object_or_raise, #set_instance_variables_from_hash, #singleton_class
Constructor Details
#initialize(attributes) ⇒ PayerInfoInput
Returns a new instance of PayerInfoInput.
14 15 16 17 18 19 |
# File 'lib/braintree/graphql/inputs/payer_info_input.rb', line 14 def initialize(attributes) @attrs = attributes.keys set_instance_variables_from_hash(attributes) @billing_address = attributes[:billing_address] ? BillingAddressInput.new(attributes[:billing_address]) : nil @shipping_address = attributes[:shipping_address] ? ShippingAddressInput.new(attributes[:shipping_address]) : nil end |
Instance Attribute Details
#attrs ⇒ Object (readonly)
Returns the value of attribute attrs.
5 6 7 |
# File 'lib/braintree/graphql/inputs/payer_info_input.rb', line 5 def attrs @attrs end |
#billing_address ⇒ Object (readonly)
Returns the value of attribute billing_address.
6 7 8 |
# File 'lib/braintree/graphql/inputs/payer_info_input.rb', line 6 def billing_address @billing_address end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
7 8 9 |
# File 'lib/braintree/graphql/inputs/payer_info_input.rb', line 7 def email @email end |
#given_name ⇒ Object (readonly)
Returns the value of attribute given_name.
8 9 10 |
# File 'lib/braintree/graphql/inputs/payer_info_input.rb', line 8 def given_name @given_name end |
#phone_country_code ⇒ Object (readonly)
Returns the value of attribute phone_country_code.
9 10 11 |
# File 'lib/braintree/graphql/inputs/payer_info_input.rb', line 9 def phone_country_code @phone_country_code end |
#phone_number ⇒ Object (readonly)
Returns the value of attribute phone_number.
10 11 12 |
# File 'lib/braintree/graphql/inputs/payer_info_input.rb', line 10 def phone_number @phone_number end |
#shipping_address ⇒ Object (readonly)
Returns the value of attribute shipping_address.
11 12 13 |
# File 'lib/braintree/graphql/inputs/payer_info_input.rb', line 11 def shipping_address @shipping_address end |
#surname ⇒ Object (readonly)
Returns the value of attribute surname.
12 13 14 |
# File 'lib/braintree/graphql/inputs/payer_info_input.rb', line 12 def surname @surname end |
Instance Method Details
#inspect ⇒ Object
21 22 23 24 |
# File 'lib/braintree/graphql/inputs/payer_info_input.rb', line 21 def inspect inspected_attributes = @attrs.map { |attr| "#{attr}:#{send(attr).inspect}" } "#<#{self.class} #{inspected_attributes.join(" ")}>" end |
#to_graphql_variables ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/braintree/graphql/inputs/payer_info_input.rb', line 26 def to_graphql_variables { "billingAddress" => billing_address&.to_graphql_variables, "email" => email, "givenName" => given_name, "phoneCountryCode" => phone_country_code, "phoneNumber" => phone_number, "shippingAddress" => shipping_address&.to_graphql_variables, "surname" => surname }.compact end |