Class: PGB::Keyword
- Inherits:
-
Expression
- Object
- Expression
- PGB::Keyword
- Defined in:
- lib/pgb/keyword.rb
Constant Summary collapse
- SUPPORTED_VALUES =
%w[TRUE FALSE NULL].freeze
Instance Method Summary collapse
-
#initialize(value) ⇒ Keyword
constructor
A new instance of Keyword.
- #to_sql ⇒ Object
Methods included from SQLDisplayable
Constructor Details
#initialize(value) ⇒ Keyword
Returns a new instance of Keyword.
7 8 9 10 11 12 13 |
# File 'lib/pgb/keyword.rb', line 7 def initialize(value) if SUPPORTED_VALUES.include?(normalized(value)) @value = normalized(value) else raise Error, "Unsupported keyword: #{value.inspect}" end end |
Instance Method Details
#to_sql ⇒ Object
15 16 17 |
# File 'lib/pgb/keyword.rb', line 15 def to_sql value end |