Class: FilterParam::Operator
- Inherits:
-
Object
- Object
- FilterParam::Operator
show all
- Defined in:
- lib/filter_param/operator.rb
Class Method Summary
collapse
Class Method Details
.binaries ⇒ Object
27
28
29
|
# File 'lib/filter_param/operator.rb', line 27
def binaries
with_type(:binary).map(&:tag)
end
|
.for(operator_tag) ⇒ Object
23
24
25
|
# File 'lib/filter_param/operator.rb', line 23
def for(operator_tag)
registry[operator_tag]
end
|
.operator_tag(operator_tag) ⇒ Object
10
11
12
|
# File 'lib/filter_param/operator.rb', line 10
def operator_tag(operator_tag)
@operator_tag ||= operator_tag
end
|
.register(operator_clazz) ⇒ Object
14
15
16
17
|
# File 'lib/filter_param/operator.rb', line 14
def register(operator_clazz)
operator_tag = operator_clazz.tag
registry[operator_tag] = operator_clazz
end
|
.tag ⇒ Object
19
20
21
|
# File 'lib/filter_param/operator.rb', line 19
def tag
@operator_tag
end
|
.type ⇒ Object
4
5
6
7
8
|
# File 'lib/filter_param/operator.rb', line 4
def type
return :unary if method(:sql).arity == 1
:binary
end
|
.unaries ⇒ Object
31
32
33
|
# File 'lib/filter_param/operator.rb', line 31
def unaries
with_type(:unary).map(&:tag)
end
|