Class: Ohm::Set
- Inherits:
-
Object
- Object
- Ohm::Set
- Defined in:
- lib/ohm/scope.rb
Overview
In Ohm v1.2, the Set initialize method is defined on itself. Hence the trick of doing a module OverloadedSet with an initialize method doesn’t work anymore.
The simplest way to solve that as of now is to duplicate and extend the #initialize method for Ohm::Set.
Granted it’s not the ideal way, the drawbacks are outweighed by the simplicity and performance of this approach versus other monkey-patching techniques.
Instance Method Summary collapse
-
#initialize(model, namespace, key) ⇒ Set
constructor
A new instance of Set.
Constructor Details
#initialize(model, namespace, key) ⇒ Set
Returns a new instance of Set.
30 31 32 33 34 35 36 |
# File 'lib/ohm/scope.rb', line 30 def initialize(model, namespace, key) @model = model @namespace = namespace @key = key extend model::DefinedScopes if defined?(model::DefinedScopes) end |