class OoxmlParser::Borders
Borders
data
Attributes
Public Class Methods
Source
# File lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb, line 10 def initialize(parent: nil) @left = BordersProperties.new @right = BordersProperties.new @top = BordersProperties.new @bottom = BordersProperties.new @between = BordersProperties.new @inner_horizontal = BordersProperties.new @inner_vertical = BordersProperties.new super end
Calls superclass method
OoxmlParser::OOXMLDocumentObject::new
Public Instance Methods
Source
# File lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb, line 40 def ==(other) @left == other.left && @right == other.right && @top == other.top && @bottom == other.bottom if other.is_a?(Borders) end
Compare this object to other @param other [Object] any other object @return [True, False] result of comparision
Source
# File lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb, line 23 def copy new_borders = Borders.new new_borders.left = @left if @left new_borders.right = @right if @right new_borders.top = @top if @top new_borders.bottom = @bottom if @bottom new_borders.inner_vertical = @inner_vertical if @inner_vertical new_borders.inner_horizontal = @inner_horizontal if @inner_horizontal new_borders.between = @between if @between new_borders.display = @display if @display new_borders.bar = @bar if @bar new_borders end
Method to copy object @return [Borders] copied object
Source
# File lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb, line 44 def each_border yield(bottom) yield(inner_horizontal) yield(inner_vertical) yield(left) yield(right) yield(top) end
Source
# File lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb, line 53 def each_side yield(bottom) yield(left) yield(right) yield(top) end
Source
# File lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb, line 76 def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'lnL', 'left' @left = TableCellLine.new(parent: self).parse(node_child) when 'lnR', 'right' @right = TableCellLine.new(parent: self).parse(node_child) when 'lnT', 'top' @top = TableCellLine.new(parent: self).parse(node_child) when 'lnB', 'bottom' @bottom = TableCellLine.new(parent: self).parse(node_child) when 'insideV' @inner_vertical = TableCellLine.new(parent: self).parse(node_child) when 'insideH' @inner_horizontal = TableCellLine.new(parent: self).parse(node_child) end end self end
Parse Borders
object @param node [Nokogiri::XML:Element] node to parse @return [Borders] result of parsing
Source
# File lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb, line 61 def to_s "Left border: #{left}, Right: #{right}, Top: #{top}, Bottom: #{bottom}" end
@return [String] result of convert of object to string
Source
# File lib/ooxml_parser/common_parser/common_data/table/row/cell/properties/borders.rb, line 65 def visible? visible = false each_side do |current_size| visible ||= current_size.visible? end visible end