Class: Ansr::Arel::Nodes::Facet

Inherits:
ConfiguredUnary show all
Defined in:
lib/ansr/arel/nodes.rb

Instance Attribute Summary

Attributes inherited from ConfiguredUnary

#expr, #opts

Instance Method Summary collapse

Methods inherited from ConfiguredUnary

#initialize, #method_missing

Constructor Details

This class inherits a constructor from Ansr::Arel::Nodes::ConfiguredUnary

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Ansr::Arel::Nodes::ConfiguredUnary

Instance Method Details

#limit(*val) ⇒ Object



32
33
34
35
# File 'lib/ansr/arel/nodes.rb', line 32

def limit(*val)
  @opts[:limit] = val.first.to_s if val.first
  @opts[:limit]
end

#order(*val) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/ansr/arel/nodes.rb', line 19

def order(*val)
  if val.first
    val = val.first.downcase.to_sym if String === val
    @opts[:order] = val if val == :asc or val == :desc
  end
  @opts[:order]
end

#prefix(*val) ⇒ Object



27
28
29
30
# File 'lib/ansr/arel/nodes.rb', line 27

def prefix(*val)
  @opts[:prefix] = val.first.to_s if val.first
  @opts[:prefix]
end