Class: HttpDecoy::Route
- Inherits:
-
Object
- Object
- HttpDecoy::Route
- Defined in:
- lib/http_decoy/route.rb
Overview
Represents a single declared route: method + path pattern + optional scenario.
Instance Attribute Summary collapse
-
#handler_block ⇒ Object
readonly
Returns the value of attribute handler_block.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
-
#scenario ⇒ Object
readonly
Returns the value of attribute scenario.
Instance Method Summary collapse
-
#initialize(method, pattern, scenario: nil, &block) ⇒ Route
constructor
A new instance of Route.
Constructor Details
#initialize(method, pattern, scenario: nil, &block) ⇒ Route
Returns a new instance of Route.
8 9 10 11 12 13 |
# File 'lib/http_decoy/route.rb', line 8 def initialize(method, pattern, scenario: nil, &block) @method = method.to_s.upcase @pattern = pattern @scenario = scenario @handler_block = block end |
Instance Attribute Details
#handler_block ⇒ Object (readonly)
Returns the value of attribute handler_block.
6 7 8 |
# File 'lib/http_decoy/route.rb', line 6 def handler_block @handler_block end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
6 7 8 |
# File 'lib/http_decoy/route.rb', line 6 def method @method end |
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
6 7 8 |
# File 'lib/http_decoy/route.rb', line 6 def pattern @pattern end |
#scenario ⇒ Object (readonly)
Returns the value of attribute scenario.
6 7 8 |
# File 'lib/http_decoy/route.rb', line 6 def scenario @scenario end |