Parent

Typhoeus::Filter

Attributes

method_name[R]

Public Class Methods

new(method_name, options = {}) click to toggle source
# File lib/typhoeus/filter.rb, line 5
def initialize(method_name, options = {})
  @method_name = method_name
  @options = options
end

Public Instance Methods

apply_filter?(method_name) click to toggle source
# File lib/typhoeus/filter.rb, line 10
def apply_filter?(method_name)
  if @options[:only]
    if @options[:only].instance_of? Symbol
      @options[:only] == method_name
    else
      @options[:only].include?(method_name)
    end
  elsif @options[:except]
    if @options[:except].instance_of? Symbol
      @options[:except] != method_name
    else
      !@options[:except].include?(method_name)
    end
  else
    true
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.