Class: Twocheckout::Company

Inherits:
HashObject show all
Includes:
Singleton
Defined in:
lib/twocheckout/company.rb

Instance Method Summary collapse

Methods inherited from HashObject

#inspect, #method_missing

Constructor Details

#initializeCompany

Returns company info



10
11
12
13
# File 'lib/twocheckout/company.rb', line 10

def initialize
  response = Twocheckout::API.request(:get, 'acct/detail_company_info')
  super(response['vendor_company_info'])
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Twocheckout::HashObject

Instance Method Details

#contact_infoObject

Returns contact info



18
19
20
21
22
23
24
# File 'lib/twocheckout/company.rb', line 18

def contact_info
  if @contact_info.nil?
    response = Twocheckout::API.request(:get, 'acct/detail_contact_info')
    @contact_info = HashObject.new(response['vendor_contact_info'])
  end
  @contact_info
end