Class: Braintree::PhoneInput
- Inherits:
-
Object
- Object
- Braintree::PhoneInput
- Includes:
- BaseModule
- Defined in:
- lib/braintree/graphql/inputs/phone_input.rb
Instance Attribute Summary collapse
-
#attrs ⇒ Object
readonly
Returns the value of attribute attrs.
-
#country_phone_code ⇒ Object
readonly
Returns the value of attribute country_phone_code.
-
#extension_number ⇒ Object
readonly
Returns the value of attribute extension_number.
-
#phone_number ⇒ Object
readonly
Returns the value of attribute phone_number.
Instance Method Summary collapse
-
#initialize(attributes) ⇒ PhoneInput
constructor
A new instance of PhoneInput.
- #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) ⇒ PhoneInput
Returns a new instance of PhoneInput.
12 13 14 15 |
# File 'lib/braintree/graphql/inputs/phone_input.rb', line 12 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.
7 8 9 |
# File 'lib/braintree/graphql/inputs/phone_input.rb', line 7 def attrs @attrs end |
#country_phone_code ⇒ Object (readonly)
Returns the value of attribute country_phone_code.
8 9 10 |
# File 'lib/braintree/graphql/inputs/phone_input.rb', line 8 def country_phone_code @country_phone_code end |
#extension_number ⇒ Object (readonly)
Returns the value of attribute extension_number.
10 11 12 |
# File 'lib/braintree/graphql/inputs/phone_input.rb', line 10 def extension_number @extension_number end |
#phone_number ⇒ Object (readonly)
Returns the value of attribute phone_number.
9 10 11 |
# File 'lib/braintree/graphql/inputs/phone_input.rb', line 9 def phone_number @phone_number end |
Instance Method Details
#inspect ⇒ Object
17 18 19 20 |
# File 'lib/braintree/graphql/inputs/phone_input.rb', line 17 def inspect inspected_attributes = @attrs.map { |attr| "#{attr}:#{send(attr).inspect}" } "#<#{self.class} #{inspected_attributes.join(" ")}>" end |
#to_graphql_variables ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/braintree/graphql/inputs/phone_input.rb', line 22 def to_graphql_variables variables = {} variables["countryPhoneCode"] = country_phone_code if country_phone_code variables["phoneNumber"] = phone_number if phone_number variables["extensionNumber"] = extension_number if extension_number variables end |