Class: Braintree::CustomerSessionInput

Inherits:
Object
  • Object
show all
Includes:
BaseModule
Defined in:
lib/braintree/graphql/inputs/customer_session_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) ⇒ CustomerSessionInput

Returns a new instance of CustomerSessionInput.



19
20
21
22
23
# File 'lib/braintree/graphql/inputs/customer_session_input.rb', line 19

def initialize(attributes)
    @attrs = attributes.keys
    set_instance_variables_from_hash(attributes)
    @phone = attributes[:phone] ? PhoneInput.new(attributes[:phone]) : nil
end

Instance Attribute Details

#attrsObject (readonly)

Returns the value of attribute attrs.



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

def attrs
  @attrs
end

#device_fingerprint_idObject (readonly)

Returns the value of attribute device_fingerprint_id.



14
15
16
# File 'lib/braintree/graphql/inputs/customer_session_input.rb', line 14

def device_fingerprint_id
  @device_fingerprint_id
end

#emailObject (readonly)

Returns the value of attribute email.



10
11
12
# File 'lib/braintree/graphql/inputs/customer_session_input.rb', line 10

def email
  @email
end

#hashed_emailObject (readonly)

Returns the value of attribute hashed_email.



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

def hashed_email
  @hashed_email
end

#hashed_phoneObject (readonly)

Returns the value of attribute hashed_phone.



13
14
15
# File 'lib/braintree/graphql/inputs/customer_session_input.rb', line 13

def hashed_phone
  @hashed_phone
end

#paypal_app_installedObject (readonly)

Returns the value of attribute paypal_app_installed.



15
16
17
# File 'lib/braintree/graphql/inputs/customer_session_input.rb', line 15

def paypal_app_installed
  @paypal_app_installed
end

#phoneObject (readonly)

Returns the value of attribute phone.



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

def phone
  @phone
end

#user_agentObject (readonly)

Returns the value of attribute user_agent.



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

def user_agent
  @user_agent
end

#venmo_app_installedObject (readonly)

Returns the value of attribute venmo_app_installed.



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

def venmo_app_installed
  @venmo_app_installed
end

Instance Method Details

#inspectObject



25
26
27
28
# File 'lib/braintree/graphql/inputs/customer_session_input.rb', line 25

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

#to_graphql_variablesObject



30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/braintree/graphql/inputs/customer_session_input.rb', line 30

def to_graphql_variables
    variables = {}
    variables["email"] = email if email
    variables["hashedEmail"] = hashed_email if hashed_email
    variables["phone"] = phone.to_graphql_variables if phone
    variables["hashedPhone"] = hashed_phone if hashed_phone
    variables["deviceFingerprintId"] = device_fingerprint_id if device_fingerprint_id
    variables["paypalAppInstalled"] = paypal_app_installed if paypal_app_installed
    variables["venmoAppInstalled"] = venmo_app_installed if venmo_app_installed
    variables["userAgent"] = user_agent if user_agent
    variables
end