class DateTime

Public Class Methods

new(*args, &block) click to toggle source
# File lib/glimmer-dsl-opal/ext/date.rb, line 5
def initialize(*args, &block)
  @time = Time.new(*args, &block)
  methods_to_exclude = [:to_date, :to_time, :==, :eql?, :class]
  methods_to_define = @time.methods - methods_to_exclude
  methods_to_define.each do |method|
    singleton_class.define_method(method) do |*args, &block|
      @time.send(method, *args, &block)
    end
  end
end

Public Instance Methods

==(other) click to toggle source
# File lib/glimmer-dsl-opal/ext/date.rb, line 24
def ==(other)
  return false if other.class != self.class
  year == other.year and
    month == other.month and
    day == other.day and
    hour == other.hour and
    min == other.min and
    sec == other.sec
end
Also aliased as: eql?
eql?(other)
Alias for: ==
to_date() click to toggle source
# File lib/glimmer-dsl-opal/ext/date.rb, line 16
def to_date
  @time.to_date
end
to_time() click to toggle source
# File lib/glimmer-dsl-opal/ext/date.rb, line 20
def to_time
  @time
end