class Graphlient::Adapters::HTTP::Adapter

Attributes

options[RW]
url[RW]

Public Class Methods

new(url, options = {}) { |self| ... } click to toggle source
# File lib/graphlient/adapters/http/adapter.rb, line 7
def initialize(url, options = {}, &_block)
  @url = url
  @options = options.dup if options
  yield self if block_given?
end

Public Instance Methods

execute(*) click to toggle source
# File lib/graphlient/adapters/http/adapter.rb, line 23
def execute(*)
  raise NotImplementedError
end
headers() click to toggle source
# File lib/graphlient/adapters/http/adapter.rb, line 13
def headers
  options[:headers] if options
end
http_options() click to toggle source
# File lib/graphlient/adapters/http/adapter.rb, line 17
def http_options
  return {} unless options

  options[:http_options] || {}
end

Private Instance Methods

configure_http_options(client_options) click to toggle source
# File lib/graphlient/adapters/http/adapter.rb, line 29
def configure_http_options(client_options)
  http_options.each do |k, v|
    begin
      client_options.send("#{k}=", v)
    rescue NoMethodError => e
      raise Graphlient::Errors::HttpOptionsError, e.message
    end
  end
end