Module: ElasticGraph::Support::TimeSet::RangeFactory

Defined in:
lib/elastic_graph/support/time_set.rb

Class Method Summary collapse

Class Method Details

.build_non_empty(lower_bound, upper_bound) ⇒ Object

Helper method for building a range from the given bounds. Returns either a built range, or, if the given bounds produce an empty range, returns nil.



285
286
287
288
289
# File 'lib/elastic_graph/support/time_set.rb', line 285

def self.build_non_empty(lower_bound, upper_bound)
  if lower_bound.nil? || upper_bound.nil? || lower_bound <= upper_bound
    ::Range.new(lower_bound, upper_bound)
  end
end