lib/rubyXL/objects/border.rb in rubyXL-3.2.0 vs lib/rubyXL/objects/border.rb in rubyXL-3.2.1

- old
+ new

@@ -4,16 +4,12 @@ module RubyXL class BorderEdge < OOXMLObject define_attribute(:style, RubyXL::ST_BorderStyle, :default => 'none') define_child_node(RubyXL::Color) - - def ==(other) - style == other.style - end end - + # http://www.schemacentral.com/sc/ooxml/e-ssml_border-2.html class Border < OOXMLObject define_attribute(:diagonalUp, :bool) define_attribute(:diagonalDown, :bool) define_attribute(:outline, :bool, :default => true) @@ -23,42 +19,28 @@ define_child_node(RubyXL::BorderEdge, :node_name => :bottom) define_child_node(RubyXL::BorderEdge, :node_name => :diagonal) define_child_node(RubyXL::BorderEdge, :node_name => :vertical) define_child_node(RubyXL::BorderEdge, :node_name => :horizontal) define_element_name 'border' - + def get_edge_style(direction) edge = self.send(direction) edge && edge.style end def set_edge_style(direction, style) self.send("#{direction}=", RubyXL::BorderEdge.new(:style => style)) end + end - def ==(other) - (diagonal_up == other.diagonal_up) && - (diagonal_down == other.diagonal_down) && - (outline == other.outline) && - (left == other.left) && - (right == other.right) && - (top == other.top) && - (bottom == other.bottom) && - (diagonal == other.diagonal) && - (vertical == other.vertical) && - (horizontal == other.horizontal) + # http://www.schemacentral.com/sc/ooxml/e-ssml_borders-1.html + class Borders < OOXMLContainerObject + define_child_node(RubyXL::Border, :collection => :with_count) + define_element_name 'borders' + + def self.defaults + self.new(:_ => [ RubyXL::Border.new ]) end - end - - # http://www.schemacentral.com/sc/ooxml/e-ssml_borders-1.html - class Borders < OOXMLContainerObject - define_child_node(RubyXL::Border, :collection => :with_count) - define_element_name 'borders' - - def self.defaults - self.new(:_ => [ RubyXL::Border.new ]) - end - - end - -end + end + +end