Class: Crabfarm::TransitionService::DecoratorChain
- Inherits:
-
Object
- Object
- Crabfarm::TransitionService::DecoratorChain
- Defined in:
- lib/crabfarm/transition_service.rb
Instance Attribute Summary collapse
-
#base ⇒ Object
readonly
Returns the value of attribute base.
-
#new ⇒ Object
readonly
Returns the value of attribute new.
Instance Method Summary collapse
- #decorate(_navigator) ⇒ Object
-
#initialize(_base, _new) ⇒ DecoratorChain
constructor
A new instance of DecoratorChain.
Constructor Details
#initialize(_base, _new) ⇒ DecoratorChain
Returns a new instance of DecoratorChain.
57 58 59 60 |
# File 'lib/crabfarm/transition_service.rb', line 57 def initialize(_base, _new) @base = _base @new = _new end |
Instance Attribute Details
#base ⇒ Object (readonly)
Returns the value of attribute base.
55 56 57 |
# File 'lib/crabfarm/transition_service.rb', line 55 def base @base end |
#new ⇒ Object (readonly)
Returns the value of attribute new.
55 56 57 |
# File 'lib/crabfarm/transition_service.rb', line 55 def new @new end |
Instance Method Details
#decorate(_navigator) ⇒ Object
62 63 64 65 66 |
# File 'lib/crabfarm/transition_service.rb', line 62 def decorate(_navigator) _navigator = @new.decorate _navigator return _navigator if @base.nil? @base.decorate _navigator end |