class Tomlrb::LocalDate

Public Class Methods

new(year, month, day) click to toggle source
# File lib/tomlrb/local_date.rb, line 9
def initialize(year, month, day)
  @time = Time.new(year, month, day, 0, 0, 0, '-00:00')
end

Public Instance Methods

==(other) click to toggle source
# File lib/tomlrb/local_date.rb, line 24
def ==(other)
  other.kind_of?(self.class) &&
    to_time == other.to_time
end
inspect() click to toggle source
# File lib/tomlrb/local_date.rb, line 29
def inspect
  "#<#{self.class}: #{to_s}>"
end
to_s() click to toggle source
# File lib/tomlrb/local_date.rb, line 20
def to_s
  @time.strftime('%F')
end
to_time(offset='-00:00') click to toggle source

@param offset see {LocalDateTime#to_time} @return [Time] 00:00:00 of the date

# File lib/tomlrb/local_date.rb, line 15
def to_time(offset='-00:00')
  return @time if offset == '-00:00'
  Time.new(year, month, day, 0, 0, 0, offset)
end