Class: HttpStub::Server::Stub::Triggers
- Inherits:
-
Object
- Object
- HttpStub::Server::Stub::Triggers
- Defined in:
- lib/http_stub/server/stub/triggers.rb
Constant Summary collapse
- EMPTY =
HttpStub::Server::Stub::Triggers.new.freeze
Instance Attribute Summary collapse
-
#scenario_names ⇒ Object
readonly
Returns the value of attribute scenario_names.
-
#stubs ⇒ Object
readonly
Returns the value of attribute stubs.
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Triggers
constructor
A new instance of Triggers.
- #to_json(*args) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(args = {}) ⇒ Triggers
Returns a new instance of Triggers.
13 14 15 16 17 18 |
# File 'lib/http_stub/server/stub/triggers.rb', line 13 def initialize(args={}) resolved_args = DEFAULT_ARGS.merge(args || {}) @scenario_names = resolved_args[:scenario_names] @stubs = create_stubs(resolved_args[:stubs]) @description = resolved_args.to_s end |
Instance Attribute Details
#scenario_names ⇒ Object (readonly)
Returns the value of attribute scenario_names.
11 12 13 |
# File 'lib/http_stub/server/stub/triggers.rb', line 11 def scenario_names @scenario_names end |
#stubs ⇒ Object (readonly)
Returns the value of attribute stubs.
11 12 13 |
# File 'lib/http_stub/server/stub/triggers.rb', line 11 def stubs @stubs end |
Instance Method Details
#to_json(*args) ⇒ Object
30 31 32 |
# File 'lib/http_stub/server/stub/triggers.rb', line 30 def to_json(*args) { scenario_names: @scenario_names, stubs: @stubs }.to_json(*args) end |
#to_s ⇒ Object
34 35 36 |
# File 'lib/http_stub/server/stub/triggers.rb', line 34 def to_s @description end |