Class: GoogleWallet::Configuration
- Inherits:
-
Object
- Object
- GoogleWallet::Configuration
- Defined in:
- lib/google_wallet/configuration.rb
Instance Attribute Summary collapse
-
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
-
#debug_mode ⇒ Object
Returns the value of attribute debug_mode.
-
#issuer_id ⇒ Object
Returns the value of attribute issuer_id.
-
#json_credentials ⇒ Object
Returns the value of attribute json_credentials.
-
#logger ⇒ Object
Returns the value of attribute logger.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #load_credentials_from_file(file_path) ⇒ Object
Constructor Details
#initialize ⇒ Configuration
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_endpoint ⇒ Object
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_mode ⇒ Object
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_id ⇒ Object
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_credentials ⇒ Object
Returns the value of attribute json_credentials.
7 8 9 |
# File 'lib/google_wallet/configuration.rb', line 7 def json_credentials @json_credentials end |
#logger ⇒ Object
Returns the value of attribute logger.
7 8 9 |
# File 'lib/google_wallet/configuration.rb', line 7 def logger @logger end |
Class Method Details
.logger ⇒ Object
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.}" end end |