Class: ROM::SQL::Postgres::Values::Range
- Inherits:
-
Struct
- Object
- Struct
- ROM::SQL::Postgres::Values::Range
- Defined in:
- lib/rom/sql/extensions/postgres/types/range.rb
Constant Summary collapse
- PAREN_LEFT =
'('.freeze
- PAREN_RIGHT =
')'.freeze
Instance Attribute Summary collapse
-
#bounds ⇒ Object
Returns the value of attribute bounds.
-
#lower ⇒ Object
Returns the value of attribute lower.
-
#upper ⇒ Object
Returns the value of attribute upper.
Instance Method Summary collapse
- #exclude_begin? ⇒ Boolean
- #exclude_end? ⇒ Boolean
-
#initialize(lower, upper, bounds = :'[)') ⇒ Range
constructor
A new instance of Range.
Constructor Details
#initialize(lower, upper, bounds = :'[)') ⇒ Range
Returns a new instance of Range.
13 14 15 |
# File 'lib/rom/sql/extensions/postgres/types/range.rb', line 13 def initialize(lower, upper, bounds = :'[)') super end |
Instance Attribute Details
#bounds ⇒ Object
Returns the value of attribute bounds
9 10 11 |
# File 'lib/rom/sql/extensions/postgres/types/range.rb', line 9 def bounds @bounds end |
#lower ⇒ Object
Returns the value of attribute lower
9 10 11 |
# File 'lib/rom/sql/extensions/postgres/types/range.rb', line 9 def lower @lower end |
#upper ⇒ Object
Returns the value of attribute upper
9 10 11 |
# File 'lib/rom/sql/extensions/postgres/types/range.rb', line 9 def upper @upper end |
Instance Method Details
#exclude_begin? ⇒ Boolean
17 18 19 |
# File 'lib/rom/sql/extensions/postgres/types/range.rb', line 17 def exclude_begin? bounds[0] == PAREN_LEFT end |
#exclude_end? ⇒ Boolean
21 22 23 |
# File 'lib/rom/sql/extensions/postgres/types/range.rb', line 21 def exclude_end? bounds[1] == PAREN_RIGHT end |