Class: GoogleWallet::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/google_wallet/configuration.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



9
10
11
12
13
14
15
# File 'lib/google_wallet/configuration.rb', line 9

def initialize
  @api_endpoint = 'https://walletobjects.googleapis.com/walletobjects/v1'
  @json_credentials = nil
  @issuer_id = nil
  @debug_mode = false
  @logger = Logger.new(STDOUT)
end

Instance Attribute Details

#api_endpointObject

Returns the value of attribute api_endpoint.



7
8
9
# File 'lib/google_wallet/configuration.rb', line 7

def api_endpoint
  @api_endpoint
end

#debug_modeObject

Returns the value of attribute debug_mode.



7
8
9
# File 'lib/google_wallet/configuration.rb', line 7

def debug_mode
  @debug_mode
end

#issuer_idObject

Returns the value of attribute issuer_id.



7
8
9
# File 'lib/google_wallet/configuration.rb', line 7

def issuer_id
  @issuer_id
end

#json_credentialsObject

Returns the value of attribute json_credentials.



7
8
9
# File 'lib/google_wallet/configuration.rb', line 7

def json_credentials
  @json_credentials
end

#loggerObject

Returns the value of attribute logger.



7
8
9
# File 'lib/google_wallet/configuration.rb', line 7

def logger
  @logger
end

Class Method Details

.loggerObject



17
18
19
# File 'lib/google_wallet/configuration.rb', line 17

def self.logger
  @logger
end

Instance Method Details

#load_credentials_from_file(file_path) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/google_wallet/configuration.rb', line 21

def load_credentials_from_file(file_path)
  begin
    json_data = JSON.parse(File.read(file_path))
    @json_credentials = json_data
  rescue JSON::ParserError, Errno::ENOENT => e
    raise "Error loading JSON credentials from file: #{e.message}"
  end
end