Class: ApiSim::SmartRequest

Inherits:
SimpleDelegator
  • Object
show all
Defined in:
lib/api_sim/matchers/dynamic_request_matcher.rb

Instance Method Summary collapse

Constructor Details

#initialize(obj, matcher) ⇒ SmartRequest

Returns a new instance of SmartRequest.



40
41
42
43
# File 'lib/api_sim/matchers/dynamic_request_matcher.rb', line 40

def initialize(obj, matcher)
  super(obj)
  @matcher = matcher
end

Instance Method Details

#[](requested_part) ⇒ Object



45
46
47
# File 'lib/api_sim/matchers/dynamic_request_matcher.rb', line 45

def [](requested_part)
  @matcher.route.match(path)[requested_part]
end