Module: GaExampleGem::Configuration
- Included in:
- Client
- Defined in:
- lib/ga_example_gem/configuration.rb
Overview
This is the configuration module that allows us to setup an api_key using a pattern close to the Twitter or MtGox gem
Instance Attribute Summary collapse
-
#api_key ⇒ Object
This is our API key.
Instance Method Summary collapse
-
#configure {|_self| ... } ⇒ Object
This yields a block that can be iterated on Its useful for being able to set values to the attr_accessor.
-
#reset ⇒ Object
This reset our API key and is called when the client is initialized.
Instance Attribute Details
#api_key ⇒ Object
This is our API key. We aren’t really using it anywhere, but you could imagine using it with HTTP requests
11 12 13 |
# File 'lib/ga_example_gem/configuration.rb', line 11 def api_key @api_key end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
This yields a block that can be iterated on Its useful for being able to set values to the attr_accessor
16 17 18 |
# File 'lib/ga_example_gem/configuration.rb', line 16 def configure yield self end |
#reset ⇒ Object
This reset our API key and is called when the client is initialized
22 23 24 25 |
# File 'lib/ga_example_gem/configuration.rb', line 22 def reset self.api_key = nil self end |