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(args) ⇒ Scenario
constructor
A new instance of Scenario.
- #matches?(name, _logger) ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(args) ⇒ Scenario
Returns a new instance of Scenario.
9 10 11 12 13 14 15 |
# File 'lib/http_stub/server/scenario/scenario.rb', line 9 def initialize(args) @args = args @name = args["name"] @links = HttpStub::Server::Scenario::Links.new(@name) @stubs = create_stubs(args["stubs"]) @triggered_scenarios = create_triggers(args["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
#matches?(name, _logger) ⇒ Boolean
17 18 19 |
# File 'lib/http_stub/server/scenario/scenario.rb', line 17 def matches?(name, _logger) @name == name end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/http_stub/server/scenario/scenario.rb', line 21 def to_s @args.to_s end |