Class: BothIsGood::DualImplementer
- Inherits:
-
Object
- Object
- BothIsGood::DualImplementer
- Includes:
- Memoization
- Defined in:
- lib/both_is_good.rb
Instance Attribute Summary collapse
-
#opts ⇒ Object
readonly
Returns the value of attribute opts.
-
#positional ⇒ Object
readonly
Returns the value of attribute positional.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
Instance Method Summary collapse
- #apply_aliases! ⇒ Object
-
#initialize(*positional, target:, original:, replacement:, **opts) ⇒ DualImplementer
constructor
A new instance of DualImplementer.
Methods included from Memoization
Constructor Details
#initialize(*positional, target:, original:, replacement:, **opts) ⇒ DualImplementer
Returns a new instance of DualImplementer.
43 44 45 46 47 48 49 50 51 |
# File 'lib/both_is_good.rb', line 43 def initialize(*positional, target:, original:, replacement:, **opts) @target = target @positional = positional @kw_original = original @kw_replacement = replacement @opts = opts validate! end |
Instance Attribute Details
#opts ⇒ Object (readonly)
Returns the value of attribute opts.
53 54 55 |
# File 'lib/both_is_good.rb', line 53 def opts @opts end |
#positional ⇒ Object (readonly)
Returns the value of attribute positional.
53 54 55 |
# File 'lib/both_is_good.rb', line 53 def positional @positional end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
53 54 55 |
# File 'lib/both_is_good.rb', line 53 def target @target end |
Instance Method Details
#apply_aliases! ⇒ Object
59 60 61 62 |
# File 'lib/both_is_good.rb', line 59 def apply_aliases! target.alias_method(original, name) if aliased_original? target.alias_method(replacement, name) if aliased_replacement? end |