Method: ElasticGraph::Support::TimeSet::RangeFactory.build_non_empty
- Defined in:
- lib/elastic_graph/support/time_set.rb
.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.
287 288 289 290 291 |
# File 'lib/elastic_graph/support/time_set.rb', line 287 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 |