lib/osm/term.rb in osm-0.0.21 vs lib/osm/term.rb in osm-0.0.22

- old
+ new

@@ -45,9 +45,20 @@ :start => Osm::parse_date(data['startdate']), :finish => Osm::parse_date(data['enddate']), ) end + # Get the term's data for use with the API + # @return [Hash] + def to_api + { + 'term' => name, + 'start' => start.strftime(Osm::OSM_DATE_FORMAT), + 'end' => finish.strftime(Osm::OSM_DATE_FORMAT), + 'termid' => id + } + end + # Determine if the term is completly before the passed date # @param [Date] date # @return [Boolean] if the term is completly before the passed date def before?(date) return finish < date.to_date