Class: Zemanta::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/zemanta/configuration.rb,
lib/zemanta/configuration/null_storage.rb

Defined Under Namespace

Classes: NullStorage

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_keyObject

Returns the value of attribute api_key.



3
4
5
# File 'lib/zemanta/configuration.rb', line 3

def api_key
  @api_key
end

#cache_storageObject

Returns the value of attribute cache_storage.



3
4
5
# File 'lib/zemanta/configuration.rb', line 3

def cache_storage
  @cache_storage
end

#character_limitObject

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_optsObject

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

#formatObject

Returns the value of attribute format.



3
4
5
# File 'lib/zemanta/configuration.rb', line 3

def format
  @format
end

Instance Method Details

#end_pointObject



19
20
21
# File 'lib/zemanta/configuration.rb', line 19

def end_point
  "http://api.zemanta.com/services/rest/0.0/"
end

#request_optsObject



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