Class: WireMockMapper::Builders::ScenarioBuilder
- Inherits:
-
Object
- Object
- WireMockMapper::Builders::ScenarioBuilder
- Defined in:
- lib/builders/scenario_builder.rb
Instance Method Summary collapse
- #in_scenario(scenario) ⇒ Object
-
#initialize ⇒ ScenarioBuilder
constructor
Scenarios allow for stateful behavior.
- #to_hash ⇒ Object
- #to_json ⇒ Object
- #will_set_state(state) ⇒ Object
- #with_state(state) ⇒ Object
Constructor Details
#initialize ⇒ ScenarioBuilder
Scenarios allow for stateful behavior
6 7 8 |
# File 'lib/builders/scenario_builder.rb', line 6 def initialize @options = {} end |
Instance Method Details
#in_scenario(scenario) ⇒ Object
10 11 12 13 |
# File 'lib/builders/scenario_builder.rb', line 10 def in_scenario(scenario) @options[:scenarioName] = scenario self end |
#to_hash ⇒ Object
25 26 27 28 |
# File 'lib/builders/scenario_builder.rb', line 25 def to_hash(*) = @options.merge(@url_match.to_hash) if @url_match || @options end |
#to_json ⇒ Object
30 31 32 |
# File 'lib/builders/scenario_builder.rb', line 30 def to_json(*) to_hash.to_json end |
#will_set_state(state) ⇒ Object
20 21 22 23 |
# File 'lib/builders/scenario_builder.rb', line 20 def will_set_state(state) @options[:newScenarioState] = state self end |
#with_state(state) ⇒ Object
15 16 17 18 |
# File 'lib/builders/scenario_builder.rb', line 15 def with_state(state) @options[:requiredScenarioState] = state self end |