class FortuneTeller::MomentStructMoment

Utility class returned while scheduling with `on`

Constants

DESTRUCTIVE

Public Class Methods

new(struct, date) click to toggle source
# File lib/fortuneteller/moment_struct.rb, line 93
def initialize(struct, date)
  @struct = struct
  @date = date
end

Public Instance Methods

method_missing(name, *args) click to toggle source
Calls superclass method
# File lib/fortuneteller/moment_struct.rb, line 98
def method_missing(name, *args)
  if name.to_s.end_with?('=') || DESTRUCTIVE.include?(name)
    @struct.read_for_writing(@date).send(name, *args)
  else
    obj = @struct.read(@date)
    if name.to_s.end_with?('=') || obj.respond_to?(name)
      @struct.read(@date).send(name, *args)
    else
      super
    end
  end
end
respond_to_missing?(name, include_private = false) click to toggle source
Calls superclass method
# File lib/fortuneteller/moment_struct.rb, line 111
def respond_to_missing?(name, include_private = false)
  @struct.start.respond_to?(name) || super
end