Class: Graphlient::Adapters::HTTP::Adapter

Inherits:
Object
  • Object
show all
Defined in:
lib/graphlient/adapters/http/adapter.rb

Direct Known Subclasses

FaradayAdapter, HTTPAdapter

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, options = {}) {|_self| ... } ⇒ Adapter

Returns a new instance of Adapter.

Yields:

  • (_self)

Yield Parameters:



7
8
9
10
11
# 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

Instance Attribute Details

#optionsObject

Returns the value of attribute options.



5
6
7
# File 'lib/graphlient/adapters/http/adapter.rb', line 5

def options
  @options
end

#urlObject

Returns the value of attribute url.



5
6
7
# File 'lib/graphlient/adapters/http/adapter.rb', line 5

def url
  @url
end

Instance Method Details

#executeObject

Raises:

  • (NotImplementedError)


23
24
25
# File 'lib/graphlient/adapters/http/adapter.rb', line 23

def execute(*)
  raise NotImplementedError
end

#headersObject



13
14
15
# File 'lib/graphlient/adapters/http/adapter.rb', line 13

def headers
  options[:headers] if options
end

#http_optionsObject



17
18
19
20
21
# File 'lib/graphlient/adapters/http/adapter.rb', line 17

def http_options
  return {} unless options

  options[:http_options] || {}
end