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