Module: StaticModel::Shortcut::ClassMethods

Defined in:
lib/static_model/shortcut.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_sym, *arguments, &block) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/static_model/shortcut.rb', line 8

def method_missing(method_sym, *arguments, &block)
  if exist?(method_sym.to_s)
    find(method_sym.to_s)
  else
    super
  end
end

Instance Method Details

#respond_to?(method_sym, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/static_model/shortcut.rb', line 16

def respond_to?(method_sym, include_private = false)
  exist?(method_sym.to_s) || super
end