Class: Perpetuity::Postgres::TextValue
- Inherits:
-
Object
- Object
- Perpetuity::Postgres::TextValue
- Defined in:
- lib/perpetuity/postgres/text_value.rb
Instance Method Summary collapse
-
#initialize(value) ⇒ TextValue
constructor
A new instance of TextValue.
- #to_s ⇒ Object
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_s ⇒ Object
8 9 10 |
# File 'lib/perpetuity/postgres/text_value.rb', line 8 def to_s "'#{@value}'" end |