lib/osm/term.rb in osm-1.2.22 vs lib/osm/term.rb in osm-1.2.23
- old
+ new
@@ -1,8 +1,9 @@
module Osm
class Term < Osm::Model
+ SORT_BY = [:section_id, :start, :id]
# @!attribute [rw] id
# @return [Fixnum] the id for the term
# @!attribute [rw] section_id
# @return [Fixnum] the section the term belongs to
@@ -228,17 +229,9 @@
# @return [Boolean] if the term started before the date and finishes after the date
def contains_date?(date)
return false if start.nil?
return false if finish.nil?
return (start <= date) && (finish >= date)
- end
-
- # Compare Term based on section_id, start then id
- def <=>(another_term)
- result = self.section_id <=> another_term.section_id
- result = self.start <=> another_term.start if result == 0
- result = self.id <=> another_term.id if result == 0
- return result
end
end # Class Term
end # Module