Module: Deck::Repeatable

Included in:
Container::Add, Container::Archive, Container::Cmd, Container::Env
Defined in:
lib/deck/repeatable.rb

Defined Under Namespace

Classes: Step

Instance Method Summary collapse

Instance Method Details

#attributesObject



18
19
20
21
# File 'lib/deck/repeatable.rb', line 18

def attributes
  @index ||= 0
  @repeatable_attr[@index]
end

#nextObject



23
24
25
# File 'lib/deck/repeatable.rb', line 23

def next
  @index += 1
end

#step(&block) ⇒ Object



10
11
12
13
14
15
16
# File 'lib/deck/repeatable.rb', line 10

def step(&block)
  @repeatable_attr ||= []
  step = Step.new
  step.instance_eval(&block) if block_given?

  @repeatable_attr << step.attributes
end