Class: Sbmt::Pact::Consumer::InteractionContents

Inherits:
Hash
  • Object
show all
Defined in:
lib/sbmt/pact/consumer/interaction_contents.rb

Constant Summary collapse

BASIC_FORMAT =
:basic
PLUGIN_FORMAT =
:plugin

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(contents_hash, format) ⇒ InteractionContents

Returns a new instance of InteractionContents.



20
21
22
23
# File 'lib/sbmt/pact/consumer/interaction_contents.rb', line 20

def initialize(contents_hash, format)
  init_hash(contents_hash, format).each_pair { |k, v| self[k] = v }
  @format = format
end

Instance Attribute Details

#formatObject (readonly)

Returns the value of attribute format.



10
11
12
# File 'lib/sbmt/pact/consumer/interaction_contents.rb', line 10

def format
  @format
end

Class Method Details

.basic(contents_hash) ⇒ Object



12
13
14
# File 'lib/sbmt/pact/consumer/interaction_contents.rb', line 12

def self.basic(contents_hash)
  new(contents_hash, BASIC_FORMAT)
end

.plugin(contents_hash) ⇒ Object



16
17
18
# File 'lib/sbmt/pact/consumer/interaction_contents.rb', line 16

def self.plugin(contents_hash)
  new(contents_hash, PLUGIN_FORMAT)
end