Module: RPCMapper::Scopes::Conditions

Defined in:
lib/rpc_mapper/scopes/conditions.rb

Constant Summary collapse

COMPARISON_CONDITIONS =
{
  :equals => [:is, :eq],
  :does_not_equal => [:not_equal_to, :is_not, :not, :ne],
  :less_than => [:lt, :before],
  :less_than_or_equal_to => [:lte],
  :greater_than => [:gt, :after],
  :greater_than_or_equal_to => [:gte],
}
WILDCARD_CONDITIONS =
{
  :like => [:contains, :includes],
  :not_like => [:does_not_include],
  :begins_with => [:bw],
  :not_begin_with => [:does_not_begin_with],
  :ends_with => [:ew],
  :not_end_with => [:does_not_end_with]
}
CONDITIONS =
{}
PRIMARY_CONDITIONS =
CONDITIONS.keys
ALIAS_CONDITIONS =
CONDITIONS.values.flatten

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args, &block) ⇒ Object (private)



52
53
54
55
56
57
58
59
# File 'lib/rpc_mapper/scopes/conditions.rb', line 52

def method_missing(name, *args, &block)
  if details = condition_details(name)
    create_condition(details[:attribute], details[:condition], args)
    send(name, *args)
  else
    super
  end
end

Instance Method Details

#respond_to?(name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


45
46
47
48
# File 'lib/rpc_mapper/scopes/conditions.rb', line 45

def respond_to?(name, include_private=false)
  super ||
  condition_details(name)
end