Class: Opinions::KeyLoader
- Inherits:
-
Object
- Object
- Opinions::KeyLoader
- Defined in:
- lib/opinions.rb
Instance Method Summary collapse
-
#initialize(key) ⇒ KeyLoader
constructor
A new instance of KeyLoader.
- #object ⇒ Object
Constructor Details
#initialize(key) ⇒ KeyLoader
Returns a new instance of KeyLoader.
101 102 103 |
# File 'lib/opinions.rb', line 101 def initialize(key) @object_class, @opinion, @object_id, @target_class = key.split(':') end |
Instance Method Details
#object ⇒ Object
105 106 107 |
# File 'lib/opinions.rb', line 105 def object Object.const_get(@object_class).find(_object_id) end |