class Aozora2Html::StyleStack
スタイルの状態管理用スタック
スタイルの入れ子を扱えるようにスタック構造になっている。 各要素は‘[コマンド文字列, 閉じる際に使うHTML文字列]`という2要素の配列になっている。
Public Class Methods
new()
click to toggle source
# File lib/aozora2html/style_stack.rb, line 9 def initialize @stack = [] end
Public Instance Methods
empty?()
click to toggle source
# File lib/aozora2html/style_stack.rb, line 17 def empty? @stack.empty? end
last()
click to toggle source
# File lib/aozora2html/style_stack.rb, line 25 def last @stack.last end
last_command()
click to toggle source
# File lib/aozora2html/style_stack.rb, line 29 def last_command @stack.last[0] end
pop()
click to toggle source
# File lib/aozora2html/style_stack.rb, line 21 def pop @stack.pop end
push(elem)
click to toggle source
# File lib/aozora2html/style_stack.rb, line 13 def push(elem) @stack.push(elem) end