Method: Date#method_missing

Defined in:
lib/when_exe/core/extension.rb

#method_missing(name, *args, &block) ⇒ Object

Note:

self で定義されていないメソッドはtm_pos で変換して処理する

その他のメソッド



88
89
90
91
92
93
94
95
96
97
98
# File 'lib/when_exe/core/extension.rb', line 88

def method_missing(name, *args, &block)
  return __method_missing(name, *args, &block) if When::Parts::MethodCash::Escape.key?(name)
  self.class.module_eval %Q{
    def #{name}(*args, &block)
      result = tm_pos.send("#{name}", *args, &block)
      result.kind_of?(When::TimeValue) ? result.to_date_or_datetime : result
    end
  } unless When::Parts::MethodCash.escape(name)
  result = tm_pos.send(name, *args, &block)
  result.kind_of?(When::TimeValue) ? result.to_date_or_datetime : result
end