Class: Ansr::Arel::Nodes::ConfiguredUnary

Inherits:
Arel::Nodes::Node
  • Object
show all
Defined in:
lib/ansr/arel/nodes.rb

Direct Known Subclasses

Facet, Filter, Highlight, ProjectionTraits, Spellcheck

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(expr, opts = {}) ⇒ ConfiguredUnary

Returns a new instance of ConfiguredUnary.



5
6
7
8
# File 'lib/ansr/arel/nodes.rb', line 5

def initialize(expr, opts={})
  @expr = expr
  @opts = opts
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



10
11
12
13
# File 'lib/ansr/arel/nodes.rb', line 10

def method_missing(method, *args)
  @opts[method] = args if args.first
  @opts[method]
end

Instance Attribute Details

#exprObject (readonly)

Returns the value of attribute expr.



3
4
5
# File 'lib/ansr/arel/nodes.rb', line 3

def expr
  @expr
end

#optsObject (readonly)

Returns the value of attribute opts.



3
4
5
# File 'lib/ansr/arel/nodes.rb', line 3

def opts
  @opts
end