Class: PoxyClient::Configuration
- Inherits:
-
Object
- Object
- PoxyClient::Configuration
- Defined in:
- lib/poxy_client/configuration.rb
Constant Summary collapse
- OPTIONS =
[:api_key, :origin, :destination, :mode, :retriever_version].freeze
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#destination ⇒ Object
Returns the value of attribute destination.
-
#mode ⇒ Object
Returns the value of attribute mode.
-
#origin ⇒ Object
Returns the value of attribute origin.
-
#retriever_version ⇒ Object
Returns the value of attribute retriever_version.
Instance Method Summary collapse
- #[](option) ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #merge(hash) ⇒ Object
- #to_hash ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
11 12 13 14 15 16 |
# File 'lib/poxy_client/configuration.rb', line 11 def initialize @origin = 'http://poxy.ws' @destination = 'http://home.herokuapp.com/' @mode = 'development' @retriever_version = VERSION end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
5 6 7 |
# File 'lib/poxy_client/configuration.rb', line 5 def api_key @api_key end |
#destination ⇒ Object
Returns the value of attribute destination.
7 8 9 |
# File 'lib/poxy_client/configuration.rb', line 7 def destination @destination end |
#mode ⇒ Object
Returns the value of attribute mode.
8 9 10 |
# File 'lib/poxy_client/configuration.rb', line 8 def mode @mode end |
#origin ⇒ Object
Returns the value of attribute origin.
6 7 8 |
# File 'lib/poxy_client/configuration.rb', line 6 def origin @origin end |
#retriever_version ⇒ Object
Returns the value of attribute retriever_version.
9 10 11 |
# File 'lib/poxy_client/configuration.rb', line 9 def retriever_version @retriever_version end |
Instance Method Details
#[](option) ⇒ Object
18 19 20 |
# File 'lib/poxy_client/configuration.rb', line 18 def [](option) send(option) end |
#merge(hash) ⇒ Object
29 30 31 |
# File 'lib/poxy_client/configuration.rb', line 29 def merge(hash) to_hash.merge(hash) end |
#to_hash ⇒ Object
22 23 24 25 26 27 |
# File 'lib/poxy_client/configuration.rb', line 22 def to_hash OPTIONS.inject({}) do |hash, option| hash[option.to_sym] = self.send(option) hash end end |