Method: Calendrier::Item#method_missing

Defined in:
lib/calendrier/item.rb

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



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/calendrier/item.rb', line 10

def method_missing(method, *args, &block)
  ret = nil

  unless obj.nil?
    if options.include?(:field)
      ret = obj.send(options[:field]).send(method)
    elsif !options[method].nil?
      if options[method].is_a?(Symbol)
        ret = obj.send(options[method])
      else
        ret = options[method]
      end
    elsif obj.respond_to?(method)
      ret = obj.send(method)
    end
  end

  ret
end