Class: HttpFake::Route

Inherits:
Object
  • Object
show all
Defined in:
lib/httpfake/route.rb

Overview

Represents a single declared route: method + path pattern + optional scenario.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(method, pattern, scenario: nil, &block) ⇒ Route

Returns a new instance of Route.



8
9
10
11
12
13
# File 'lib/httpfake/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_blockObject (readonly)

Returns the value of attribute handler_block.



6
7
8
# File 'lib/httpfake/route.rb', line 6

def handler_block
  @handler_block
end

#methodObject (readonly)

Returns the value of attribute method.



6
7
8
# File 'lib/httpfake/route.rb', line 6

def method
  @method
end

#patternObject (readonly)

Returns the value of attribute pattern.



6
7
8
# File 'lib/httpfake/route.rb', line 6

def pattern
  @pattern
end

#scenarioObject (readonly)

Returns the value of attribute scenario.



6
7
8
# File 'lib/httpfake/route.rb', line 6

def scenario
  @scenario
end