Class: RubyXL::Border

Inherits:
OOXMLObject show all
Defined in:
lib/rubyXL/objects/border.rb

Overview

Instance Attribute Summary

Attributes included from OOXMLObjectInstanceMethods

#local_namespaces

Instance Method Summary collapse

Methods included from OOXMLObjectInstanceMethods

#==, #before_write_xml, included, #index_in_collection, #initialize, #write_xml

Instance Method Details

#get_edge_color(direction) ⇒ Object


46
47
48
49
# File 'lib/rubyXL/objects/border.rb', line 46

def get_edge_color(direction)
  edge = self.send(direction)
  edge && edge.get_rgb_color
end

#get_edge_style(direction) ⇒ Object


32
33
34
35
# File 'lib/rubyXL/objects/border.rb', line 32

def get_edge_style(direction)
  edge = self.send(direction)
  edge && edge.style
end

#set_edge_color(direction, color) ⇒ Object


51
52
53
54
55
56
57
58
59
# File 'lib/rubyXL/objects/border.rb', line 51

def set_edge_color(direction, color)
  edge = self.send(direction)
  if edge
    edge.set_rgb_color(color)
  else
    self.send("#{direction}=", RubyXL::BorderEdge.new)
    self.send(direction).set_rgb_color(color)
  end
end

#set_edge_style(direction, style) ⇒ Object


37
38
39
40
41
42
43
44
# File 'lib/rubyXL/objects/border.rb', line 37

def set_edge_style(direction, style)
  edge = self.send(direction)
  if edge
    edge.style = style
  else
    self.send("#{direction}=", RubyXL::BorderEdge.new(:style => style))
  end
end