Class: Axlsx::BorderPr

Inherits:
Object
  • Object
show all
Includes:
OptionsParser
Defined in:
lib/axlsx/stylesheet/border_pr.rb

Overview

A border part.

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from OptionsParser

#parse_options

Constructor Details

#initialize(options = {}) ⇒ BorderPr

Creates a new Border Part Object

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • color (Color)
  • name (Symbol)
  • style (Symbol)

See Also:



49
50
51
52
53
54
# File 'lib/axlsx/stylesheet/border_pr.rb', line 49

def initialize(options = {})
  parse_options(options)
  # options.each do |o|
  #  self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
  # end
end

Instance Attribute Details

#colorColor

Returns The color of this border part.

Returns:

  • (Color)

    The color of this border part.



9
10
11
# File 'lib/axlsx/stylesheet/border_pr.rb', line 9

def color
  @color
end

#nameSymbol

Note:

The following are allowed :start :end :left :right :top :bottom :diagonal :vertical :horizontal

Returns The name of this border part.

Returns:

  • (Symbol)

    The name of this border part



42
43
44
# File 'lib/axlsx/stylesheet/border_pr.rb', line 42

def name
  @name
end

#styleSymbol

Note:

The following are allowed :none :thin :medium :dashed :dotted :thick :double :hair :mediumDashed :dashDot :mediumDashDot :dashDotDot :mediumDashDotDot :slantDashDot

Returns The style of this border part.

Returns:

  • (Symbol)

    The style of this border part.



28
29
30
# File 'lib/axlsx/stylesheet/border_pr.rb', line 28

def style
  @style
end

Instance Method Details

#to_xml_string(str = +'')) ⇒ String

Serializes the object

Parameters:

  • str (String) (defaults to: +''))

Returns:

  • (String)


77
78
79
80
81
# File 'lib/axlsx/stylesheet/border_pr.rb', line 77

def to_xml_string(str = +'')
  str << '<' << @name.to_s << ' style="' << @style.to_s << '">'
  @color.to_xml_string(str) if @color.is_a?(Color)
  str << '</' << @name.to_s << '>'
end