Sha256: 33914bfc215b43e083b305e49effc16c0bf2cb18dce75c66821179292b862bb6

Contents?: true

Size: 308 Bytes

Versions: 6

Compression:

Stored size: 308 Bytes

Contents

class NicePartials::Partial::Stack
  def initialize
    @partials = []
    reset_locator
  end
  delegate :prepend, :shift, :first, to: :@partials

  def partial
    @partials.public_send @locator
  end

  def locate_previous
    @locator = :second
  end

  def reset_locator
    @locator = :first
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
nice_partials-0.10.0 lib/nice_partials/partial/stack.rb
nice_partials-0.9.3 lib/nice_partials/partial/stack.rb
nice_partials-0.9.2 lib/nice_partials/partial/stack.rb
nice_partials-0.9.1 lib/nice_partials/partial/stack.rb
nice_partials-0.9.0 lib/nice_partials/partial/stack.rb
nice_partials-0.1.9 lib/nice_partials/partial/stack.rb