Class: Super::ViewChain

Inherits:
Object
  • Object
show all
Defined in:
lib/super/view_chain.rb

Instance Method Summary collapse

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

#chainObject



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_pathObject



21
22
23
# File 'lib/super/view_chain.rb', line 21

def to_partial_path
  "view_chain"
end