Class: Gemstash::RackEnvRewriter

Inherits:
Object
  • Object
show all
Defined in:
lib/gemstash/rack_env_rewriter.rb

Overview

Detects patterns in the Rack env variables related to URI and rewrites them, extracting parameters.

Defined Under Namespace

Classes: Context

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(regexp) ⇒ RackEnvRewriter

Returns a new instance of RackEnvRewriter.



10
11
12
# File 'lib/gemstash/rack_env_rewriter.rb', line 10

def initialize(regexp)
  @regexp = regexp
end

Instance Attribute Details

#regexpObject (readonly)

Returns the value of attribute regexp.



8
9
10
# File 'lib/gemstash/rack_env_rewriter.rb', line 8

def regexp
  @regexp
end

Instance Method Details

#for(rack_env) ⇒ Object



14
15
16
# File 'lib/gemstash/rack_env_rewriter.rb', line 14

def for(rack_env)
  Context.new(self, rack_env)
end