Class: Braintree::PayPalPayeeInput

Inherits:
Object
  • Object
show all
Includes:
BaseModule
Defined in:
lib/braintree/graphql/inputs/paypal_payee_input.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BaseModule

included

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) ⇒ PayPalPayeeInput

Returns a new instance of PayPalPayeeInput.



11
12
13
14
# File 'lib/braintree/graphql/inputs/paypal_payee_input.rb', line 11

def initialize(attributes)
    @attrs = attributes.keys
    set_instance_variables_from_hash(attributes)
end

Instance Attribute Details

#attrsObject (readonly)

Returns the value of attribute attrs.



7
8
9
# File 'lib/braintree/graphql/inputs/paypal_payee_input.rb', line 7

def attrs
  @attrs
end

#client_idObject (readonly)

Returns the value of attribute client_id.



9
10
11
# File 'lib/braintree/graphql/inputs/paypal_payee_input.rb', line 9

def client_id
  @client_id
end

#email_addressObject (readonly)

Returns the value of attribute email_address.



8
9
10
# File 'lib/braintree/graphql/inputs/paypal_payee_input.rb', line 8

def email_address
  @email_address
end

Instance Method Details

#inspectObject



16
17
18
19
# File 'lib/braintree/graphql/inputs/paypal_payee_input.rb', line 16

def inspect
    inspected_attributes = @attrs.map { |attr| "#{attr}:#{send(attr).inspect}" }
    "#<#{self.class} #{inspected_attributes.join(" ")}>"
end

#to_graphql_variablesObject



21
22
23
24
25
26
# File 'lib/braintree/graphql/inputs/paypal_payee_input.rb', line 21

def to_graphql_variables
    variables = {}
    variables["emailAddress"] = email_address if email_address
    variables["clientId"] = client_id if client_id
    variables
end