class PMLCode::Content
Public Class Methods
new(lines)
click to toggle source
# File lib/pmlcode/content.rb, line 9 def initialize(lines) @lines = lines end
parse(text)
click to toggle source
# File lib/pmlcode/content.rb, line 4 def self.parse(text) parser = Parser.new(text) new(parser.result) end
Public Instance Methods
each(&block)
click to toggle source
# File lib/pmlcode/content.rb, line 17 def each(&block) @lines.each(&block) end
has_part?(name)
click to toggle source
# File lib/pmlcode/content.rb, line 13 def has_part?(name) @lines.any? { |l| l.in_part?(name) } end
to_s()
click to toggle source
# File lib/pmlcode/content.rb, line 21 def to_s @lines.map(&:text) end