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

#empty?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'lib/super/view_chain.rb', line 25

def empty?
  chain.empty?
end

#insert(*args, **kwargs) ⇒ Object



9
10
11
12
13
14
15
# File 'lib/super/view_chain.rb', line 9

def insert(*args, **kwargs)
  if instance_variable_defined?(:@chain)
    raise Error::ViewChain::ChainAlreadyStarted
  end

  @data.insert(*args, **kwargs)
end

#shiftObject



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

def shift
  chain.shift
end

#to_partial_pathObject



17
18
19
# File 'lib/super/view_chain.rb', line 17

def to_partial_path
  "view_chain"
end