Class: Misc::Range
- Inherits:
-
Object
- Object
- Misc::Range
- Includes:
- AttributesReader
- Defined in:
- lib/misc/range.rb
Overview
A bucket associated with a specific range
Instance Method Summary collapse
-
#initialize(from: nil, to: nil, key: '') ⇒ Range
constructor
A new instance of Range.
-
#settings ⇒ Object
return [Hash] serialized json query for object.
Methods included from AttributesReader
Constructor Details
#initialize(from: nil, to: nil, key: '') ⇒ Range
Returns a new instance of Range.
11 12 13 14 15 |
# File 'lib/misc/range.rb', line 11 def initialize(from: nil, to: nil, key: '') @from = from if from.present? @to = to if to.present? @key = key if key.present? end |
Instance Method Details
#settings ⇒ Object
return [Hash] serialized json query for object
18 19 20 21 22 23 24 |
# File 'lib/misc/range.rb', line 18 def settings settings = {} settings[:key] = @key if @key.present? settings[:from] = @from if @from.present? settings[:to] = @to if @to.present? settings end |