Class: Log::Analyzer::Pattern

Inherits:
ActionDispatch::Journey::Path::Pattern
  • Object
show all
Defined in:
lib/log-analyzer/pattern.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(strexp, request_method, uri_pattern) ⇒ Pattern



15
16
17
18
19
# File 'lib/log-analyzer/pattern.rb', line 15

def initialize(strexp, request_method, uri_pattern)
  @request_method = request_method
  @uri_pattern = uri_pattern
  super(strexp)
end

Instance Attribute Details

#request_methodObject

Returns the value of attribute request_method.



3
4
5
# File 'lib/log-analyzer/pattern.rb', line 3

def request_method
  @request_method
end

#uri_patternObject

Returns the value of attribute uri_pattern.



3
4
5
# File 'lib/log-analyzer/pattern.rb', line 3

def uri_pattern
  @uri_pattern
end

Class Method Details

.from_string(request_method, uri_pattern, requirements) ⇒ Object



5
6
7
8
9
10
11
12
13
# File 'lib/log-analyzer/pattern.rb', line 5

def self.from_string(request_method, uri_pattern, requirements)
  requirements = if requirements.nil? || requirements.empty?
                   {}
                 else
                   eval(requirements)
                 end
  requirements ||= {}
  new(ActionDispatch::Journey::Router::Strexp.build(uri_pattern, requirements, ["/.?"], true), request_method, uri_pattern)
end