Class: Rusql::Operand

Inherits:
Object
  • Object
show all
Defined in:
lib/rusql/operand.rb

Instance Method Summary collapse

Constructor Details

#initialize(op) ⇒ Operand

Returns a new instance of Operand.

Raises:



3
4
5
6
# File 'lib/rusql/operand.rb', line 3

def initialize(op)
  raise TypeException.new(String, op.class) unless op.is_a?(String)
  @op = op
end

Instance Method Details

#like(v) ⇒ Object

Raises:



32
33
34
35
36
37
38
39
40
41
# File 'lib/rusql/operand.rb', line 32

def like(v)
  raise TypeException.new(String, v.class) unless v.is_a?(String)

  c = BasicCondition.new
  c.type = :like
  c.left = self
  c.right = v
  
  c
end

#to_sObject



43
44
45
# File 'lib/rusql/operand.rb', line 43

def to_s
  @op
end