Class: Perpetuity::Postgres::TextValue

Inherits:
Object
  • Object
show all
Defined in:
lib/perpetuity/postgres/text_value.rb

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ TextValue

Returns a new instance of TextValue.



4
5
6
# File 'lib/perpetuity/postgres/text_value.rb', line 4

def initialize value
  @value = value.to_s.gsub("'") { "''" }
end

Instance Method Details

#to_sObject



8
9
10
# File 'lib/perpetuity/postgres/text_value.rb', line 8

def to_s
  "'#{@value}'"
end