class DoctorNinja::Parsers::Run

Public Class Methods

applicable_to?(node) click to toggle source
# File lib/doctor_ninja/parsers/run.rb, line 6
def self.applicable_to?(node)
  node.name == "r"
end

Public Instance Methods

parse() click to toggle source
# File lib/doctor_ninja/parsers/run.rb, line 10
def parse
  tag = nil
  if @node.xpath(".//w:rPr/w:b").length > 0
    tag = "b"
  end

  tags.inject(parse_children){|text,tag| "<#{tag}>#{text}</#{tag}>"}
end
tags() click to toggle source
# File lib/doctor_ninja/parsers/run.rb, line 19
def tags
  @node.xpath("./w:rPr").children
    .map{|n| n.name}
    .select{|n| @@available_tags.include? n}
end