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 5 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 11 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 19 def predicate_method?(method) method[-1] == '?' && @attr && @attr.values.include?(method[0..-2]) end