class Pincers::Chenso::Factory

Public Instance Methods

load_backend(_options) click to toggle source
# File lib/pincers/chenso/factory.rb, line 8
def load_backend(_options)
  _options[:headers] = default_headers(_options).merge! _options.fetch(:headers, {})
  client = Pincers::Http::Client.build_from_options _options
  Pincers::Chenso::Backend.new client
end

Private Instance Methods

default_headers(_options) click to toggle source
# File lib/pincers/chenso/factory.rb, line 16
def default_headers(_options)
  {
    'User-Agent' => (_options[:user_agent] || default_user_agent)
  }
end
default_user_agent() click to toggle source
# File lib/pincers/chenso/factory.rb, line 22
def default_user_agent
  "Pincers/#{Pincers::VERSION}"
end