Class: Axlsx::Builder::Title

Inherits:
Element show all
Defined in:
lib/axlsx/builder.rb

Instance Attribute Summary collapse

Attributes inherited from Element

#border_thickness, #borders, #comment, #format, #merge, #pos, #text

Instance Method Summary collapse

Methods inherited from Element

#col, #color, #font, #h_align, #row, #style, #v_align

Constructor Details

#initialize(attrs) ⇒ Title

Returns a new instance of Title.



109
110
111
112
113
114
# File 'lib/axlsx/builder.rb', line 109

def initialize attrs
  h_align = :center # Default
  v_align = :center # Default
  attrs.each {|key, val| self.send("#{key.to_s}=", val)}
  super
end

Instance Attribute Details

Returns the value of attribute hyperlink.



107
108
109
# File 'lib/axlsx/builder.rb', line 107

def hyperlink
  @hyperlink
end

#listObject

Returns the value of attribute list.



107
108
109
# File 'lib/axlsx/builder.rb', line 107

def list
  @list
end

Instance Method Details

#combined_styleObject



116
117
118
119
120
121
# File 'lib/axlsx/builder.rb', line 116

def combined_style
  combined_style = super
  combined_style.merge!(b: true, border: {style: :thick, color: '00000000'})
  combined_style.merge!(bg_color: self.color) if self.color
  combined_style
end