module Enumerize::Predicatable

Public Instance Methods

respond_to_missing?(method, include_private=false) click to toggle source
Calls superclass method
# File lib/enumerize/predicatable.rb, line 3
def respond_to_missing?(method, include_private=false)
  predicate_method?(method) || super
end

Private Instance Methods

method_missing(method, *args, &block) click to toggle source
Calls superclass method
# File lib/enumerize/predicatable.rb, line 9
def method_missing(method, *args, &block)
  if predicate_method?(method)
    predicate_call(method[0..-2], *args, &block)
  else
    super
  end
end
predicate_method?(method) click to toggle source
# File lib/enumerize/predicatable.rb, line 17
def predicate_method?(method)
  method[-1] == '?' && @attr.values.include?(method[0..-2])
end