Module: Rql::Dsl::Maths

Included in:
Context
Defined in:
lib/rql/dsl/maths.rb

Instance Method Summary collapse

Instance Method Details

#*(value) ⇒ Object



12
13
14
# File 'lib/rql/dsl/maths.rb', line 12

def *(value)
  Context.new(@model, arel * (value.is_a?(Context) ? value.arel : value))
end

#+(value) ⇒ Object



4
5
6
# File 'lib/rql/dsl/maths.rb', line 4

def +(value)
  Context.new(@model, arel + (value.is_a?(Context) ? value.arel : value))
end

#-(value) ⇒ Object



8
9
10
# File 'lib/rql/dsl/maths.rb', line 8

def -(value)
  Context.new(@model, arel - (value.is_a?(Context) ? value.arel : value))
end

#/(value) ⇒ Object



16
17
18
# File 'lib/rql/dsl/maths.rb', line 16

def /(value)
  Context.new(@model, arel / (value.is_a?(Context) ? value.arel : value))
end