class PPZ::AbstractWrapperModel
Public Class Methods
new()
click to toggle source
# File lib/doc/model/abstract/wrapper-model.rb, line 2 def initialize @children = [] end
Public Instance Methods
append(el)
click to toggle source
把 el 加入到 children
# File lib/doc/model/abstract/wrapper-model.rb, line 7 def append el el.father_model = self left_model = @children[-1] if left_model left_model.right_model = el el.left_model = el el.index = left_model.index + 1 else el.index = 1 end @children.push el end
to_html()
click to toggle source
# File lib/doc/model/abstract/wrapper-model.rb, line 21 def to_html @children .map { |child| child.to_html } .join end