class TelegramBot::Date

Attributes

datetime[RW]

Public Class Methods

from(date) click to toggle source
Calls superclass method
# File lib/telegram_bot/date.rb, line 11
def self.from(date)
  case date
  when ::DateTime, ::Date, ::Time
    new(date)
  when Integer
    new(Time.at(date).to_datetime)
  when String
    new(Datetime.parse(date))
  when TelegramBot::Date
    date
  else
    super
  end
end
members() click to toggle source
# File lib/telegram_bot/date.rb, line 7
def self.members
  []
end
new(datetime) click to toggle source
# File lib/telegram_bot/date.rb, line 33
def initialize(datetime)
  @datetime = datetime
end

Public Instance Methods

members() click to toggle source
# File lib/telegram_bot/date.rb, line 29
def members
  self.class.members
end
method_missing(sym, *args, &blk) click to toggle source
# File lib/telegram_bot/date.rb, line 37
def method_missing(sym, *args, &blk)
  @datetime.send(sym, *args, &blk)
end