Class: Moneta::Stack::DSL Private
- Inherits:
-
Object
- Object
- Moneta::Stack::DSL
- Defined in:
- lib/moneta/stack.rb
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.
Instance Attribute Summary collapse
- #stack ⇒ Object readonly private
Instance Method Summary collapse
- #add(store = nil, &block) ⇒ Object private
-
#initialize(options, &block) ⇒ DSL
constructor
private
A new instance of DSL.
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.
20 21 22 23 |
# File 'lib/moneta/stack.rb', line 20 def initialize(, &block) @stack = [:stack].to_a instance_eval(&block) end |
Instance Attribute Details
#stack ⇒ Object (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.
18 19 20 |
# File 'lib/moneta/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.
25 26 27 28 29 |
# File 'lib/moneta/stack.rb', line 25 def add(store = nil, &block) raise ArgumentError, 'Only argument or block allowed' if store && block @stack << (store || Moneta.build(&block)) nil end |