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.
15 16 17 |
# File 'lib/rom/sql/extensions/postgres/types/range.rb', line 15 def initialize(lower, upper, bounds = :'[)') super end |
Instance Attribute Details
#bounds ⇒ Object
Returns the value of attribute bounds
11 12 13 |
# File 'lib/rom/sql/extensions/postgres/types/range.rb', line 11 def bounds @bounds end |
#lower ⇒ Object
Returns the value of attribute lower
11 12 13 |
# File 'lib/rom/sql/extensions/postgres/types/range.rb', line 11 def lower @lower end |
#upper ⇒ Object
Returns the value of attribute upper
11 12 13 |
# File 'lib/rom/sql/extensions/postgres/types/range.rb', line 11 def upper @upper end |
Instance Method Details
#exclude_begin? ⇒ Boolean
19 20 21 |
# File 'lib/rom/sql/extensions/postgres/types/range.rb', line 19 def exclude_begin? bounds[0] == PAREN_LEFT end |
#exclude_end? ⇒ Boolean
23 24 25 |
# File 'lib/rom/sql/extensions/postgres/types/range.rb', line 23 def exclude_end? bounds[1] == PAREN_RIGHT end |