Class: Surrogate::Endower
- Inherits:
-
Object
- Object
- Surrogate::Endower
- Defined in:
- lib/surrogate/endower.rb
Overview
Adds surrogate behaviour to your class / singleton class / instances
please refactor me! …may not be possible :(
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#klass ⇒ Object
Returns the value of attribute klass.
Class Method Summary collapse
Instance Method Summary collapse
- #endow ⇒ Object
-
#initialize(klass, &block) ⇒ Endower
constructor
A new instance of Endower.
Constructor Details
#initialize(klass, &block) ⇒ Endower
Returns a new instance of Endower.
13 14 15 |
# File 'lib/surrogate/endower.rb', line 13 def initialize(klass, &block) self.klass, self.block = klass, block end |
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block.
11 12 13 |
# File 'lib/surrogate/endower.rb', line 11 def block @block end |
#klass ⇒ Object
Returns the value of attribute klass.
11 12 13 |
# File 'lib/surrogate/endower.rb', line 11 def klass @klass end |
Class Method Details
.endow(klass, &block) ⇒ Object
7 8 9 |
# File 'lib/surrogate/endower.rb', line 7 def self.endow(klass, &block) new(klass, &block).endow end |
Instance Method Details
#endow ⇒ Object
17 18 19 20 |
# File 'lib/surrogate/endower.rb', line 17 def endow endow_klass endow_singleton_class end |