Class: Pact::Consumer::InteractionContents
- Inherits:
-
Hash
- Object
- Hash
- Pact::Consumer::InteractionContents
- Defined in:
- lib/pact/consumer/interaction_contents.rb
Constant Summary collapse
- BASIC_FORMAT =
:basic- PLUGIN_FORMAT =
:plugin
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(contents_hash, format) ⇒ InteractionContents
constructor
A new instance of InteractionContents.
Constructor Details
#initialize(contents_hash, format) ⇒ InteractionContents
Returns a new instance of InteractionContents.
19 20 21 22 |
# File 'lib/pact/consumer/interaction_contents.rb', line 19 def initialize(contents_hash, format) init_hash(contents_hash, format).each_pair { |k, v| self[k] = v } @format = format end |
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
9 10 11 |
# File 'lib/pact/consumer/interaction_contents.rb', line 9 def format @format end |
Class Method Details
.basic(contents_hash) ⇒ Object
11 12 13 |
# File 'lib/pact/consumer/interaction_contents.rb', line 11 def self.basic(contents_hash) new(contents_hash, BASIC_FORMAT) end |
.plugin(contents_hash) ⇒ Object
15 16 17 |
# File 'lib/pact/consumer/interaction_contents.rb', line 15 def self.plugin(contents_hash) new(contents_hash, PLUGIN_FORMAT) end |