Class: Super::ViewChain
- Inherits:
-
Object
- Object
- Super::ViewChain
- Defined in:
- lib/super/view_chain.rb
Instance Method Summary collapse
- #chain ⇒ Object
-
#initialize(chain) ⇒ ViewChain
constructor
A new instance of ViewChain.
- #insert(*args, **kwargs) ⇒ Object
- #to_partial_path ⇒ Object
Constructor Details
#initialize(chain) ⇒ ViewChain
Returns a new instance of ViewChain.
5 6 7 |
# File 'lib/super/view_chain.rb', line 5 def initialize(chain) @data = ReorderableHash.new(chain) end |
Instance Method Details
#chain ⇒ Object
9 10 11 |
# File 'lib/super/view_chain.rb', line 9 def chain @chain ||= @data.values end |
#insert(*args, **kwargs) ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/super/view_chain.rb', line 13 def insert(*args, **kwargs) if instance_variable_defined?(:@chain) raise Error::ViewChain::ChainAlreadyStarted end @data.insert(*args, **kwargs) end |
#to_partial_path ⇒ Object
21 22 23 |
# File 'lib/super/view_chain.rb', line 21 def to_partial_path "view_chain" end |