class Inkcite::View::TagStack

Attributes

tag[R]

Public Class Methods

new(tag, ctx) click to toggle source
# File lib/inkcite/view/tag_stack.rb, line 9
def initialize tag, ctx
  @tag = tag
  @ctx = ctx
  @opts = []
end

Public Instance Methods

<<(opt) click to toggle source

Pushes a new set of options onto the stack for this tag.

# File lib/inkcite/view/tag_stack.rb, line 16
def << opt
  @opts << opt
end
Also aliased as: push
opts() click to toggle source

Retrieves the most recent set of options for this tag.

# File lib/inkcite/view/tag_stack.rb, line 22
def opts
  @opts.last || {}
end
pop() click to toggle source

Pops the most recent tag off of the stack.

# File lib/inkcite/view/tag_stack.rb, line 27
def pop
  if @opts.empty?
    @ctx.error 'Attempt to close an unopened tag', { :tag => tag }
    nil
  else
    @opts.pop
  end
end
push(opt)
Alias for: <<