Class: Juno::Stack::DSL Private

Inherits:
Object
  • Object
show all
Defined in:
lib/juno/stack.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

API:

  • private

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options, &block) ⇒ DSL

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Returns a new instance of DSL.

API:

  • private



20
21
22
23
# File 'lib/juno/stack.rb', line 20

def initialize(options, &block)
  @stack = options[:stack].to_a
  instance_eval(&block)
end

Instance Attribute Details

#stackObject (readonly)

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

API:

  • private



18
19
20
# File 'lib/juno/stack.rb', line 18

def stack
  @stack
end

Instance Method Details

#add(store = nil, &block) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Raises:

API:

  • private



25
26
27
28
29
# File 'lib/juno/stack.rb', line 25

def add(store = nil, &block)
  raise ArgumentError, 'Only argument or block allowed' if store && block
  @stack << (store || Juno.build(&block))
  nil
end