lib/sdl4r/parser.rb in sdl4r-0.9.1 vs lib/sdl4r/parser.rb in sdl4r-0.9.2

- old
+ new

@@ -26,11 +26,11 @@ end require File.dirname(__FILE__) + '/sdl_binary' require File.dirname(__FILE__) + '/sdl_time_span' require File.dirname(__FILE__) + '/sdl_parse_error' - require File.dirname(__FILE__) + '/tokenizer' + require File.dirname(__FILE__) + '/parser/tokenizer' # The SDL parser. # # Authors: Daniel Leuck, Philippe Vosges # @@ -410,38 +410,9 @@ date.day, time_span_with_zone.hour, time_span_with_zone.min, time_span_with_zone.sec, time_zone_offset) - end - - # An intermediate object used to store a timeSpan or the time - # component of a date/time instance. The types are disambiguated at a later stage. - # - # +seconds+ can have a fraction - # +time_zone_offset+ is a fraction of a day (equal to nil if not specified) - class TimeSpanWithZone - - private - - SECONDS_IN_DAY = 24 * 60 * 60 - - public - - def initialize(day, hour, minute, second, time_zone_offset) - @day = day - @hour = hour - @min = minute - @sec = second - @time_zone_offset = time_zone_offset - end - - attr_reader :day, :hour, :min, :sec, :time_zone_offset - - # Returns the UTC offset as a fraction of a day on the current machine - def TimeSpanWithZone.default_time_zone_offset - return Rational(Time.now.utc_offset, SECONDS_IN_DAY) - end end private ############################################################################ ## Parsers for types