Class: Vop::Chain

Inherits:
Object
  • Object
show all
Defined in:
lib/vop/objects/chain.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

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

#nextObject



12
13
14
# File 'lib/vop/objects/chain.rb', line 12

def next
  @links.shift
end