Module: CouchPotato::GhostAttributes

Defined in:
lib/couch_potato/persistence/ghost_attributes.rb

Overview

:nodoc:

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/couch_potato/persistence/ghost_attributes.rb', line 3

def method_missing(name, *)
  if (value = _document && _document[name.to_s])
    value
  else
    super
  end
end

Instance Method Details

#respond_to_missing?(name) ⇒ Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/couch_potato/persistence/ghost_attributes.rb', line 11

def respond_to_missing?(name, *)
  _document && _document[name.to_s]
end