class OoxmlParser::FontStyle

Class for working with font styles (bold,italic,underlined,strike)

Attributes

bold[RW]

@return [false,true] is bold?

italic[RW]

@return [false,true] is bold?

strike[RW]

@return [Strike] strike type

underlined[RW]

@return [Underline] underline type

Public Class Methods

new(bold = false, italic = false, underlined = Underline.new(:none), strike = :none) click to toggle source

Default constructor @param [true, false] bold is bold? @param [true, false] italic is italic? @param [true, false, String] underlined if not false or nil - default Underline, else none @param [Symbol] strike string with strike type @return [FontStyle] new font style

# File lib/ooxml_parser/common_parser/common_data/font_style.rb, line 23
def initialize(bold = false, italic = false, underlined = Underline.new(:none), strike = :none)
  @bold = bold
  @italic = italic
  @underlined = underlined == false || underlined.nil? ? Underline.new(:none) : underlined
  @strike = strike
end

Public Instance Methods

==(other) click to toggle source

Default == operator @return [true, false] true if two same, false if different

# File lib/ooxml_parser/common_parser/common_data/font_style.rb, line 32
def ==(other)
  (@bold == other.bold) && (@italic == other.italic) && (@underlined == other.underlined) && (@strike == other.strike)
end
to_s() click to toggle source

Default to_s operator @return [String] with text representation

# File lib/ooxml_parser/common_parser/common_data/font_style.rb, line 38
def to_s
  "Bold: #{@bold}, Italic: #{@italic}, Underlined: #{@underlined}, Strike: #{@strike}"
end