Class: Rack::Halt::Rule

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/halt/rule.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rule) ⇒ Rule

Returns a new instance of Rule.



5
6
7
# File 'lib/rack/halt/rule.rb', line 5

def initialize(rule)
  @rule = rule
end

Instance Attribute Details

#ruleObject (readonly)

Returns the value of attribute rule.



3
4
5
# File 'lib/rack/halt/rule.rb', line 3

def rule
  @rule
end

Instance Method Details

#matches?(rack_env) ⇒ Boolean

Returns:

  • (Boolean)


9
10
11
12
# File 'lib/rack/halt/rule.rb', line 9

def matches?(rack_env)
  path = build_path_from_env(rack_env)
  string_matches?(path, self.rule)
end