Module: Predicated::SimpleTemplatedShorthand

Includes:
Shorthand
Defined in:
lib/predicated/lib/predicated/autogen_call.rb,
lib/predicated/lib/predicated/simple_templated_predicate.rb

Instance Method Summary collapse

Methods included from Shorthand

#And, #Not, #Or

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(uppercase_cameled_method_sym, *args) ⇒ Object



31
32
33
34
35
# File 'lib/predicated/lib/predicated/autogen_call.rb', line 31

def method_missing(uppercase_cameled_method_sym, *args)
  method_sym = StringUtils.underscore(uppercase_cameled_method_sym.to_s).to_sym
  object = args
  AutogenCall.new(Placeholder, method_sym, (object.empty? ? [] : object))
end

Instance Method Details

#Call(method_sym, right = []) ⇒ Object



55
# File 'lib/predicated/lib/predicated/simple_templated_predicate.rb', line 55

def Call(method_sym, right=[]) ::Predicated::Call.new(Placeholder, method_sym, right) end

#Eq(right) ⇒ Object



49
# File 'lib/predicated/lib/predicated/simple_templated_predicate.rb', line 49

def Eq(right) ::Predicated::Equal.new(Placeholder, right) end

#Gt(right) ⇒ Object



51
# File 'lib/predicated/lib/predicated/simple_templated_predicate.rb', line 51

def Gt(right) ::Predicated::GreaterThan.new(Placeholder, right) end

#Gte(right) ⇒ Object



53
# File 'lib/predicated/lib/predicated/simple_templated_predicate.rb', line 53

def Gte(right) ::Predicated::GreaterThanOrEqualTo.new(Placeholder, right) end

#Lt(right) ⇒ Object



50
# File 'lib/predicated/lib/predicated/simple_templated_predicate.rb', line 50

def Lt(right) ::Predicated::LessThan.new(Placeholder, right) end

#Lte(right) ⇒ Object



52
# File 'lib/predicated/lib/predicated/simple_templated_predicate.rb', line 52

def Lte(right) ::Predicated::LessThanOrEqualTo.new(Placeholder, right) end