Class: Georeferencer::Configuration
- Inherits:
-
Object
- Object
- Georeferencer::Configuration
- Defined in:
- lib/georeferencer.rb
Instance Attribute Summary collapse
-
#cache ⇒ Object
Returns the value of attribute cache.
-
#connection ⇒ Object
readonly
Returns the value of attribute connection.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#perform_caching ⇒ Object
Returns the value of attribute perform_caching.
-
#proxy ⇒ Object
Returns the value of attribute proxy.
-
#ssl_options ⇒ Object
Returns the value of attribute ssl_options.
-
#subdomain ⇒ Object
Returns the value of attribute subdomain.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Instance Method Summary collapse
- #configure_connection ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
25 26 27 28 29 30 31 32 33 |
# File 'lib/georeferencer.rb', line 25 def initialize @connection ||= Her::API.new @ssl_options = {} @proxy = nil @user_agent = "Georeferencer Ruby Client #{Georeferencer::VERSION} (https://github.com/layersoflondon/georeferencer-ruby)" @cache = ActiveSupport::Cache.lookup_store(:memory_store) @perform_caching = false @logger = Logger.new(STDOUT) end |
Instance Attribute Details
#cache ⇒ Object
Returns the value of attribute cache.
22 23 24 |
# File 'lib/georeferencer.rb', line 22 def cache @cache end |
#connection ⇒ Object (readonly)
Returns the value of attribute connection.
23 24 25 |
# File 'lib/georeferencer.rb', line 23 def connection @connection end |
#logger ⇒ Object
Returns the value of attribute logger.
22 23 24 |
# File 'lib/georeferencer.rb', line 22 def logger @logger end |
#perform_caching ⇒ Object
Returns the value of attribute perform_caching.
22 23 24 |
# File 'lib/georeferencer.rb', line 22 def perform_caching @perform_caching end |
#proxy ⇒ Object
Returns the value of attribute proxy.
22 23 24 |
# File 'lib/georeferencer.rb', line 22 def proxy @proxy end |
#ssl_options ⇒ Object
Returns the value of attribute ssl_options.
22 23 24 |
# File 'lib/georeferencer.rb', line 22 def @ssl_options end |
#subdomain ⇒ Object
Returns the value of attribute subdomain.
22 23 24 |
# File 'lib/georeferencer.rb', line 22 def subdomain @subdomain end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
22 23 24 |
# File 'lib/georeferencer.rb', line 22 def user_agent @user_agent end |
Instance Method Details
#configure_connection ⇒ Object
35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/georeferencer.rb', line 35 def configure_connection raise ArgumentError, "you need to specify a georeferencer subdomain" unless @subdomain.present? @connection.setup url: "https://#{@subdomain}.georeferencer.com/#{Georeferencer::API_PATH}", ssl: @ssl_options, proxy: @proxy do |c| # Request c.use Georeferencer::Headers c.use Faraday::Request::UrlEncoded # Response c.use Georeferencer::Parser # Adapter c.use Faraday::Adapter::NetHttp end end |