Class: RecordFilter::DSL::ConjunctionDSL
- Inherits:
-
Object
- Object
- RecordFilter::DSL::ConjunctionDSL
- Defined in:
- lib/record_filter/dsl/conjunction_dsl.rb
Instance Attribute Summary collapse
-
#conjunction ⇒ Object
readonly
Returns the value of attribute conjunction.
Instance Method Summary collapse
-
#all_of(&block) ⇒ Object
conjunction.
-
#any_of(&block) ⇒ Object
conjunction.
- #filter_class ⇒ Object
-
#having(join_type_or_association, association = nil, &block) ⇒ Object
join.
-
#initialize(model_class, conjunction) ⇒ ConjunctionDSL
constructor
A new instance of ConjunctionDSL.
- #join(clazz, join_type, table_alias = nil, &block) ⇒ Object
- #none_of(&block) ⇒ Object
- #not_all_of(&block) ⇒ Object
-
#with(column, value = Restriction::DEFAULT_VALUE) ⇒ Object
restriction.
Constructor Details
#initialize(model_class, conjunction) ⇒ ConjunctionDSL
Returns a new instance of ConjunctionDSL.
7 8 9 10 |
# File 'lib/record_filter/dsl/conjunction_dsl.rb', line 7 def initialize(model_class, conjunction) @model_class = model_class @conjunction = conjunction end |
Instance Attribute Details
#conjunction ⇒ Object (readonly)
Returns the value of attribute conjunction.
5 6 7 |
# File 'lib/record_filter/dsl/conjunction_dsl.rb', line 5 def conjunction @conjunction end |
Instance Method Details
#all_of(&block) ⇒ Object
conjunction
24 25 26 27 |
# File 'lib/record_filter/dsl/conjunction_dsl.rb', line 24 def all_of(&block) @conjunction.add_conjunction(:all_of, &block) nil end |
#any_of(&block) ⇒ Object
conjunction
18 19 20 21 |
# File 'lib/record_filter/dsl/conjunction_dsl.rb', line 18 def any_of(&block) @conjunction.add_conjunction(:any_of, &block) nil end |
#filter_class ⇒ Object
53 54 55 |
# File 'lib/record_filter/dsl/conjunction_dsl.rb', line 53 def filter_class @model_class end |
#having(join_type_or_association, association = nil, &block) ⇒ Object
join
40 41 42 43 44 45 46 47 |
# File 'lib/record_filter/dsl/conjunction_dsl.rb', line 40 def having(join_type_or_association, association=nil, &block) if association.nil? association, join_type = join_type_or_association, nil else join_type = join_type_or_association end @conjunction.add_join(association, join_type, &block) end |
#join(clazz, join_type, table_alias = nil, &block) ⇒ Object
49 50 51 |
# File 'lib/record_filter/dsl/conjunction_dsl.rb', line 49 def join(clazz, join_type, table_alias=nil, &block) @conjunction.add_class_join(clazz, join_type, table_alias, &block) end |
#none_of(&block) ⇒ Object
29 30 31 32 |
# File 'lib/record_filter/dsl/conjunction_dsl.rb', line 29 def none_of(&block) @conjunction.add_conjunction(:none_of, &block) nil end |
#not_all_of(&block) ⇒ Object
34 35 36 37 |
# File 'lib/record_filter/dsl/conjunction_dsl.rb', line 34 def not_all_of(&block) @conjunction.add_conjunction(:not_all_of, &block) nil end |
#with(column, value = Restriction::DEFAULT_VALUE) ⇒ Object
restriction
13 14 15 |
# File 'lib/record_filter/dsl/conjunction_dsl.rb', line 13 def with(column, value=Restriction::DEFAULT_VALUE) return @conjunction.add_restriction(column, value) end |