Class: Braintree::Transaction::CustomerDetails

Inherits:
Object
  • Object
show all
Includes:
BaseModule
Defined in:
lib/braintree/transaction/customer_details.rb

Overview

:nodoc:

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

Returns a new instance of CustomerDetails.


15
16
17
# File 'lib/braintree/transaction/customer_details.rb', line 15

def initialize(attributes)
  set_instance_variables_from_hash attributes unless attributes.nil?
end

Instance Attribute Details

#companyObject (readonly)

Returns the value of attribute company.


6
7
8
# File 'lib/braintree/transaction/customer_details.rb', line 6

def company
  @company
end

#emailObject (readonly)

Returns the value of attribute email.


7
8
9
# File 'lib/braintree/transaction/customer_details.rb', line 7

def email
  @email
end

#faxObject (readonly)

Returns the value of attribute fax.


8
9
10
# File 'lib/braintree/transaction/customer_details.rb', line 8

def fax
  @fax
end

#first_nameObject (readonly)

Returns the value of attribute first_name.


9
10
11
# File 'lib/braintree/transaction/customer_details.rb', line 9

def first_name
  @first_name
end

#idObject (readonly)

Returns the value of attribute id.


10
11
12
# File 'lib/braintree/transaction/customer_details.rb', line 10

def id
  @id
end

#last_nameObject (readonly)

Returns the value of attribute last_name.


11
12
13
# File 'lib/braintree/transaction/customer_details.rb', line 11

def last_name
  @last_name
end

#phoneObject (readonly)

Returns the value of attribute phone.


12
13
14
# File 'lib/braintree/transaction/customer_details.rb', line 12

def phone
  @phone
end

#websiteObject (readonly)

Returns the value of attribute website.


13
14
15
# File 'lib/braintree/transaction/customer_details.rb', line 13

def website
  @website
end

Instance Method Details

#inspectObject


19
20
21
22
23
24
25
# File 'lib/braintree/transaction/customer_details.rb', line 19

def inspect
  attr_order = [:id, :first_name, :last_name, :email, :company, :website, :phone, :fax]
  formatted_attrs = attr_order.map do |attr|
    "#{attr}: #{send(attr).inspect}"
  end
  "#<#{formatted_attrs.join(", ")}>"
end