Class: Poncho::Filters::Filter

Inherits:
Object
  • Object
show all
Defined in:
lib/poncho/filters.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}, &block) ⇒ Filter

Returns a new instance of Filter.



13
14
15
16
# File 'lib/poncho/filters.rb', line 13

def initialize(options = {}, &block)
  @options = options
  @block   = block
end

Instance Attribute Details

#blockObject (readonly)

Returns the value of attribute block.



11
12
13
# File 'lib/poncho/filters.rb', line 11

def block
  @block
end

#optionsObject (readonly)

Returns the value of attribute options.



11
12
13
# File 'lib/poncho/filters.rb', line 11

def options
  @options
end

Instance Method Details

#call(*args) ⇒ Object



22
23
24
# File 'lib/poncho/filters.rb', line 22

def call(*args)
  block.call(*args)
end

#to_procObject



18
19
20
# File 'lib/poncho/filters.rb', line 18

def to_proc
  block.to_proc
end