Class: Vop::Chain
- Inherits:
-
Object
- Object
- Vop::Chain
- Defined in:
- lib/vop/objects/chain.rb
Instance Attribute Summary collapse
-
#links ⇒ Object
readonly
Returns the value of attribute links.
Instance Method Summary collapse
- #execute(request) ⇒ Object
-
#initialize(op, links) ⇒ Chain
constructor
A new instance of Chain.
- #next ⇒ Object
Constructor Details
#initialize(op, links) ⇒ Chain
Returns a new instance of Chain.
7 8 9 10 |
# File 'lib/vop/objects/chain.rb', line 7 def initialize(op, links) @op = op @links = links end |
Instance Attribute Details
#links ⇒ Object (readonly)
Returns the value of attribute links.
5 6 7 |
# File 'lib/vop/objects/chain.rb', line 5 def links @links end |
Instance Method Details
#execute(request) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/vop/objects/chain.rb', line 16 def execute(request) next_link = self.next response = nil response = next_link.execute(request) if next_link response end |
#next ⇒ Object
12 13 14 |
# File 'lib/vop/objects/chain.rb', line 12 def next @links.shift end |