Module: Hyperdrive::DSL

Extended by:
DSL
Includes:
Values
Included in:
DSL
Defined in:
lib/hyperdrive/dsl.rb,
lib/hyperdrive/dsl/resource.rb

Defined Under Namespace

Classes: Resource

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Values

default_config, default_cors_options, default_headers, definable_request_methods, http_request_methods, request_methods, supported_request_methods

Instance Attribute Details

#configObject (readonly)

Returns the value of attribute config.



9
10
11
# File 'lib/hyperdrive/dsl.rb', line 9

def config
  @config
end

#resourcesObject (readonly)

Returns the value of attribute resources.



9
10
11
# File 'lib/hyperdrive/dsl.rb', line 9

def resources
  @resources
end

Instance Method Details

#instanceObject



11
12
13
14
15
# File 'lib/hyperdrive/dsl.rb', line 11

def instance
  @config ||= default_config.dup
  @resources ||= {}
  self
end

#instrument(*args) ⇒ Object



17
18
19
20
# File 'lib/hyperdrive/dsl.rb', line 17

def instrument(*args)
  @config[:instrumenter] = @config[:instrumenter] || Hyperdrive::Instrumenters::Noop
  @config[:instrumenter].instrument(*args)
end