class Graphiti::FilterOperators::Catchall

Attributes

procs[R]

Public Class Methods

new(resource, type_name, opts) click to toggle source
# File lib/graphiti/filter_operators.rb, line 6
def initialize(resource, type_name, opts)
  @procs = {}
  defaults = resource.adapter.default_operators[type_name] || [:eq]
  if opts[:only]
    defaults = defaults.select { |op| Array(opts[:only]).include?(op) }
  end
  if opts[:except]
    defaults = defaults.reject { |op| Array(opts[:except]).include?(op) }
  end
  defaults.each do |op|
    @procs[op] = nil
  end
end

Public Instance Methods

method_missing(name, *args, &blk) click to toggle source
# File lib/graphiti/filter_operators.rb, line 20
def method_missing(name, *args, &blk)
  @procs[name] = blk
end
respond_to_missing?(*args) click to toggle source

rubocop: enable Style/MethodMissingSuper

# File lib/graphiti/filter_operators.rb, line 25
def respond_to_missing?(*args)
  true
end
to_hash() click to toggle source
# File lib/graphiti/filter_operators.rb, line 29
def to_hash
  @procs
end