Class: HttpStub::Server::Scenario::Scenario
- Inherits:
-
Object
- Object
- HttpStub::Server::Scenario::Scenario
- Defined in:
- lib/http_stub/server/scenario/scenario.rb
Instance Attribute Summary collapse
-
#links ⇒ Object
readonly
Returns the value of attribute links.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#stubs ⇒ Object
readonly
Returns the value of attribute stubs.
-
#triggered_scenarios ⇒ Object
readonly
Returns the value of attribute triggered_scenarios.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Scenario
constructor
A new instance of Scenario.
- #initially_activated? ⇒ Boolean
- #matches?(name, _logger) ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(hash) ⇒ Scenario
Returns a new instance of Scenario.
9 10 11 12 13 14 15 16 |
# File 'lib/http_stub/server/scenario/scenario.rb', line 9 def initialize(hash) @args = hash @name = hash[:name] @links = HttpStub::Server::Scenario::Links.new(@name) @initially_activated_flag = hash[:activated] @stubs = create_stubs(hash[:stubs]) @triggered_scenarios = create_triggers(hash[:triggered_scenario_names]) end |
Instance Attribute Details
#links ⇒ Object (readonly)
Returns the value of attribute links.
7 8 9 |
# File 'lib/http_stub/server/scenario/scenario.rb', line 7 def links @links end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
7 8 9 |
# File 'lib/http_stub/server/scenario/scenario.rb', line 7 def name @name end |
#stubs ⇒ Object (readonly)
Returns the value of attribute stubs.
7 8 9 |
# File 'lib/http_stub/server/scenario/scenario.rb', line 7 def stubs @stubs end |
#triggered_scenarios ⇒ Object (readonly)
Returns the value of attribute triggered_scenarios.
7 8 9 |
# File 'lib/http_stub/server/scenario/scenario.rb', line 7 def triggered_scenarios @triggered_scenarios end |
Instance Method Details
#initially_activated? ⇒ Boolean
18 19 20 |
# File 'lib/http_stub/server/scenario/scenario.rb', line 18 def initially_activated? !!@initially_activated_flag end |
#matches?(name, _logger) ⇒ Boolean
22 23 24 |
# File 'lib/http_stub/server/scenario/scenario.rb', line 22 def matches?(name, _logger) @name == name end |
#to_s ⇒ Object
26 27 28 |
# File 'lib/http_stub/server/scenario/scenario.rb', line 26 def to_s @args.to_s end |