Class: Yaoc::Helper::ToProcDelegator
- Inherits:
-
SimpleDelegator
- Object
- SimpleDelegator
- Yaoc::Helper::ToProcDelegator
- Defined in:
- lib/yaoc/helper/to_proc_delegator.rb
Instance Attribute Summary collapse
-
#_initialisation_proc ⇒ Object
Returns the value of attribute _initialisation_proc.
-
#_initialisation_proc_loaded ⇒ Object
Returns the value of attribute _initialisation_proc_loaded.
Instance Method Summary collapse
- #__getobj__ ⇒ Object
- #class ⇒ Object
-
#initialize(_initialisation_proc) ⇒ ToProcDelegator
constructor
A new instance of ToProcDelegator.
- #kind_of?(some_class) ⇒ Boolean
Constructor Details
#initialize(_initialisation_proc) ⇒ ToProcDelegator
Returns a new instance of ToProcDelegator.
6 7 8 9 10 11 |
# File 'lib/yaoc/helper/to_proc_delegator.rb', line 6 def initialize(_initialisation_proc) super(nil).tap do self._initialisation_proc = _initialisation_proc self._initialisation_proc_loaded = false end end |
Instance Attribute Details
#_initialisation_proc ⇒ Object
Returns the value of attribute _initialisation_proc.
4 5 6 |
# File 'lib/yaoc/helper/to_proc_delegator.rb', line 4 def _initialisation_proc @_initialisation_proc end |
#_initialisation_proc_loaded ⇒ Object
Returns the value of attribute _initialisation_proc_loaded.
4 5 6 |
# File 'lib/yaoc/helper/to_proc_delegator.rb', line 4 def _initialisation_proc_loaded @_initialisation_proc_loaded end |
Instance Method Details
#__getobj__ ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'lib/yaoc/helper/to_proc_delegator.rb', line 14 def __getobj__ unless self._initialisation_proc_loaded self._initialisation_proc_loaded = true __setobj__(self._initialisation_proc.call()) end super end |
#class ⇒ Object
23 24 25 |
# File 'lib/yaoc/helper/to_proc_delegator.rb', line 23 def class __getobj__.class end |
#kind_of?(some_class) ⇒ Boolean
27 28 29 |
# File 'lib/yaoc/helper/to_proc_delegator.rb', line 27 def kind_of?(some_class) super || __getobj__.kind_of?(some_class) end |