Module: Request::Builder

Defined in:
lib/request/builder.rb,
lib/request/builder/dsl.rb,
lib/request/builder/result.rb,
lib/request/builder/version.rb,
lib/request/builder/connection.rb,
lib/request/builder/request_config.rb,
lib/request/builder/value_with_context.rb

Defined Under Namespace

Modules: ClassMethods, Connection, Dsl, ValueWithContext Classes: RequestConfig, Result

Constant Summary collapse

VERSION =
"0.3.1"

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.default_adapter(adapter = nil) ⇒ Object



38
39
40
41
42
# File 'lib/request/builder.rb', line 38

def self.default_adapter(adapter = nil)
  @default_adapter = adapter if adapter

  @default_adapter || :net_http
end

.included(base) ⇒ Object



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/request/builder.rb', line 15

def self.included(base)
  base.extend ClassMethods
  base.extend Dry::Initializer
  base.include Request::Builder::Dsl
  base.include Request::Builder::Connection

  class << base
    alias_method :__new, :new
    def new(*args, **kwargs)
      e = __new(*args, **kwargs)
      e.send(:set_config_context)
      e
    end
  end
end

Instance Method Details

#callObject Also known as: perform



44
45
46
47
# File 'lib/request/builder.rb', line 44

def call
  do_request
  result
end