Class: Amrita2::Filters::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/amrita2/template.rb,
lib/amrita2/template.rb

Overview

:nodoc: all

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#next_Object

Returns the value of attribute next_.



1990
1991
1992
# File 'lib/amrita2/template.rb', line 1990

def next_
  @next_
end

Class Method Details

.filter_method(*m) ⇒ Object



1991
1992
1993
1994
1995
1996
1997
1998
1999
# File 'lib/amrita2/template.rb', line 1991

def self.filter_method(*m)
  m.each do |name|
    module_eval <<-END
      def #{name}(*args,&block)
        next_.#{name}(*args,&block)
      end
    END
  end
end

.inherited(cls) ⇒ Object



2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
# File 'lib/amrita2/template.rb', line 2005

def self.inherited(cls)
  super
  def cls.[](*args, &block)
    new(*args, &block)
  end

  def cls.|(other)
    FilterArray.new(self.new) | other
  end
end

Instance Method Details

#parse_filter_a(f) ⇒ Object



2020
2021
2022
2023
2024
2025
2026
2027
# File 'lib/amrita2/template.rb', line 2020

def parse_filter_a(f)
  case f = eval(f)
  when Class
    f.new
  else
    f
  end
end

#|(other) ⇒ Object



2016
2017
2018
# File 'lib/amrita2/template.rb', line 2016

def |(other)
  FilterArray.new(self) | other
end