Class: PactBroker::Api::Decorators::DecoratorContext

Inherits:
Hash
  • Object
show all
Defined in:
lib/pact_broker/api/decorators/decorator_context.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(base_url, resource_url, env, options = {}) ⇒ DecoratorContext

Returns a new instance of DecoratorContext.



8
9
10
11
12
13
14
# File 'lib/pact_broker/api/decorators/decorator_context.rb', line 8

def initialize base_url, resource_url, env, options = {}
  @base_url = self[:base_url] = base_url
  @resource_url = self[:resource_url] = resource_url
  @resource_title = self[:resource_title] = options[:resource_title]
  @env = self[:env] = env
  merge!(options)
end

Instance Attribute Details

#base_urlObject (readonly)

Returns the value of attribute base_url.



6
7
8
# File 'lib/pact_broker/api/decorators/decorator_context.rb', line 6

def base_url
  @base_url
end

#envObject (readonly)

Returns the value of attribute env.



6
7
8
# File 'lib/pact_broker/api/decorators/decorator_context.rb', line 6

def env
  @env
end

#resource_titleObject (readonly)

Returns the value of attribute resource_title.



6
7
8
# File 'lib/pact_broker/api/decorators/decorator_context.rb', line 6

def resource_title
  @resource_title
end

#resource_urlObject (readonly)

Returns the value of attribute resource_url.



6
7
8
# File 'lib/pact_broker/api/decorators/decorator_context.rb', line 6

def resource_url
  @resource_url
end

Instance Method Details

#to_sObject



16
17
18
# File 'lib/pact_broker/api/decorators/decorator_context.rb', line 16

def to_s
  "DecoratorContext #{super}"
end