Class: Rack::Filter

Inherits:
Object
  • Object
show all
Defined in:
lib/rack/filter_param/filter.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Filter

Returns a new instance of Filter.



5
6
7
8
9
10
11
12
13
# File 'lib/rack/filter_param/filter.rb', line 5

def initialize(options)
  if options.is_a?(Hash)
    @param   = parse_param(options[:param])
    @path    = options[:path]
    @if_proc = options[:if]
  else
    @param   = parse_param(options)
  end
end

Instance Attribute Details

#if_procObject (readonly)

Returns the value of attribute if_proc.



3
4
5
# File 'lib/rack/filter_param/filter.rb', line 3

def if_proc
  @if_proc
end

#paramObject (readonly)

Returns the value of attribute param.



3
4
5
# File 'lib/rack/filter_param/filter.rb', line 3

def param
  @param
end

#pathObject (readonly)

Returns the value of attribute path.



3
4
5
# File 'lib/rack/filter_param/filter.rb', line 3

def path
  @path
end