Class: ParamsReady::Query::JoinCondition::Builder
- Inherits:
-
Object
- Object
- ParamsReady::Query::JoinCondition::Builder
- Defined in:
- lib/params_ready/query/join_clause.rb
Instance Method Summary collapse
- #build ⇒ Object
- #eq(expression, arel_table: nil) ⇒ Object
-
#initialize(expression, arel_table: nil) ⇒ Builder
constructor
A new instance of Builder.
Constructor Details
#initialize(expression, arel_table: nil) ⇒ Builder
Returns a new instance of Builder.
112 113 114 115 116 |
# File 'lib/params_ready/query/join_clause.rb', line 112 def initialize(expression, arel_table: nil) @on = Helpers::ArelBuilder::Attribute.instance(expression, arel_table: arel_table) @op = nil @to = nil end |
Instance Method Details
#build ⇒ Object
124 125 126 |
# File 'lib/params_ready/query/join_clause.rb', line 124 def build JoinCondition.new(@on, @op, @to) end |
#eq(expression, arel_table: nil) ⇒ Object
118 119 120 121 122 |
# File 'lib/params_ready/query/join_clause.rb', line 118 def eq(expression, arel_table: nil) raise ParamsReadyError, "Operator already set" unless @op.nil? @op = :eq @to = Helpers::ArelBuilder::Attribute.instance(expression, arel_table: arel_table) end |