Class: Braintree::ShippingAddressInput
- Inherits:
-
Object
- Object
- Braintree::ShippingAddressInput
- Includes:
- BaseModule
- Defined in:
- lib/braintree/graphql/inputs/shipping_address_input.rb
Instance Attribute Summary collapse
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
-
#country_code_alpha2 ⇒ Object
readonly
Returns the value of attribute country_code_alpha2.
-
#extended_address ⇒ Object
readonly
Returns the value of attribute extended_address.
-
#locality ⇒ Object
readonly
Returns the value of attribute locality.
-
#postal_code ⇒ Object
readonly
Returns the value of attribute postal_code.
-
#region ⇒ Object
readonly
Returns the value of attribute region.
-
#street_address ⇒ Object
readonly
Returns the value of attribute street_address.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ ShippingAddressInput
constructor
A new instance of ShippingAddressInput.
- #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) ⇒ ShippingAddressInput
Returns a new instance of ShippingAddressInput.
13 14 15 16 |
# File 'lib/braintree/graphql/inputs/shipping_address_input.rb', line 13 def initialize(attributes) @attrs = attributes.keys set_instance_variables_from_hash(attributes) end |
Instance Attribute Details
#attrs ⇒ Object (readonly)
Returns the value of attribute attrs.
5 6 7 |
# File 'lib/braintree/graphql/inputs/shipping_address_input.rb', line 5 def attrs @attrs end |
#country_code_alpha2 ⇒ Object (readonly)
Returns the value of attribute country_code_alpha2.
6 7 8 |
# File 'lib/braintree/graphql/inputs/shipping_address_input.rb', line 6 def country_code_alpha2 @country_code_alpha2 end |
#extended_address ⇒ Object (readonly)
Returns the value of attribute extended_address.
7 8 9 |
# File 'lib/braintree/graphql/inputs/shipping_address_input.rb', line 7 def extended_address @extended_address end |
#locality ⇒ Object (readonly)
Returns the value of attribute locality.
8 9 10 |
# File 'lib/braintree/graphql/inputs/shipping_address_input.rb', line 8 def locality @locality end |
#postal_code ⇒ Object (readonly)
Returns the value of attribute postal_code.
9 10 11 |
# File 'lib/braintree/graphql/inputs/shipping_address_input.rb', line 9 def postal_code @postal_code end |
#region ⇒ Object (readonly)
Returns the value of attribute region.
10 11 12 |
# File 'lib/braintree/graphql/inputs/shipping_address_input.rb', line 10 def region @region end |
#street_address ⇒ Object (readonly)
Returns the value of attribute street_address.
11 12 13 |
# File 'lib/braintree/graphql/inputs/shipping_address_input.rb', line 11 def street_address @street_address end |
Instance Method Details
#inspect ⇒ Object
18 19 20 21 |
# File 'lib/braintree/graphql/inputs/shipping_address_input.rb', line 18 def inspect inspected_attributes = @attrs.map { |attr| "#{attr}:#{send(attr).inspect}" } "#<#{self.class} #{inspected_attributes.join(" ")}>" end |
#to_graphql_variables ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/braintree/graphql/inputs/shipping_address_input.rb', line 23 def to_graphql_variables { "countryCode" => country_code_alpha2, "extendedAddress" => extended_address, "locality" => locality, "postalCode" => postal_code, "region" => region, "streetAddress" => street_address }.compact end |