Class: Google::Cloud::Spanner::Range
- Inherits:
-
Object
- Object
- Google::Cloud::Spanner::Range
- Defined in:
- lib/google/cloud/spanner/range.rb
Overview
Range
Represents a range of rows in a table or index. A range has a start key and an end key. These keys can be open or closed, indicating if the range includes rows with that key.
Instance Attribute Summary collapse
-
#begin ⇒ Object
readonly
Returns the object that defines the beginning of the range.
-
#end ⇒ Object
readonly
Returns the object that defines the end of the range.
Instance Method Summary collapse
-
#exclude_begin? ⇒ Boolean
Returns
true
if the range excludes its beginning value. -
#exclude_end? ⇒ Boolean
Returns
true
if the range excludes its end value. -
#initialize(beginning, ending, exclude_begin: false, exclude_end: false) ⇒ Range
constructor
Creates a Spanner Range.
Constructor Details
#initialize(beginning, ending, exclude_begin: false, exclude_end: false) ⇒ Range
Creates a Spanner Range. This can be used in place of a Ruby Range when needing to exclude the beginning value.
75 76 77 78 79 80 81 |
# File 'lib/google/cloud/spanner/range.rb', line 75 def initialize beginning, ending, exclude_begin: false, exclude_end: false @begin = beginning @end = ending @exclude_begin = exclude_begin @exclude_end = exclude_end end |
Instance Attribute Details
#begin ⇒ Object (readonly)
Returns the object that defines the beginning of the range.
43 44 45 |
# File 'lib/google/cloud/spanner/range.rb', line 43 def begin @begin end |
#end ⇒ Object (readonly)
Returns the object that defines the end of the range.
47 48 49 |
# File 'lib/google/cloud/spanner/range.rb', line 47 def end @end end |
Instance Method Details
#exclude_begin? ⇒ Boolean
Returns true
if the range excludes its beginning value.
86 87 88 |
# File 'lib/google/cloud/spanner/range.rb', line 86 def exclude_begin? @exclude_begin end |
#exclude_end? ⇒ Boolean
Returns true
if the range excludes its end value.
93 94 95 |
# File 'lib/google/cloud/spanner/range.rb', line 93 def exclude_end? @exclude_end end |