Class: Zemanta::Configuration
- Inherits:
-
Object
- Object
- Zemanta::Configuration
- Defined in:
- lib/zemanta/configuration.rb,
lib/zemanta/configuration/null_storage.rb
Defined Under Namespace
Classes: NullStorage
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#cache_storage ⇒ Object
Returns the value of attribute cache_storage.
-
#character_limit ⇒ Object
Returns the value of attribute character_limit.
-
#custom_request_opts ⇒ Object
Returns the value of attribute custom_request_opts.
-
#format ⇒ Object
Returns the value of attribute format.
Instance Method Summary collapse
- #end_point ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #request_opts ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
6 7 8 9 10 |
# File 'lib/zemanta/configuration.rb', line 6 def initialize @custom_request_opts = {} @format = "json" @cache_storage = NullStorage.new end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/zemanta/configuration.rb', line 3 def api_key @api_key end |
#cache_storage ⇒ Object
Returns the value of attribute cache_storage.
3 4 5 |
# File 'lib/zemanta/configuration.rb', line 3 def cache_storage @cache_storage end |
#character_limit ⇒ Object
Returns the value of attribute character_limit.
3 4 5 |
# File 'lib/zemanta/configuration.rb', line 3 def character_limit @character_limit end |
#custom_request_opts ⇒ Object
Returns the value of attribute custom_request_opts.
3 4 5 |
# File 'lib/zemanta/configuration.rb', line 3 def custom_request_opts @custom_request_opts end |
#format ⇒ Object
Returns the value of attribute format.
3 4 5 |
# File 'lib/zemanta/configuration.rb', line 3 def format @format end |
Instance Method Details
#end_point ⇒ Object
19 20 21 |
# File 'lib/zemanta/configuration.rb', line 19 def end_point "http://api.zemanta.com/services/rest/0.0/" end |
#request_opts ⇒ Object
12 13 14 15 16 17 |
# File 'lib/zemanta/configuration.rb', line 12 def request_opts { api_key: actual_api_key, format: @format }.merge(@custom_request_opts) end |