Class: OoxmlParser::FontStyle
- Inherits:
-
Object
- Object
- OoxmlParser::FontStyle
- Defined in:
- lib/ooxml_parser/common_parser/common_data/font_style.rb
Instance Attribute Summary collapse
-
#bold ⇒ false, true
Is bold?.
-
#italic ⇒ false, true
Is bold?.
-
#strike ⇒ Strike
Strike type.
-
#underlined ⇒ Underline
Underline type.
Instance Method Summary collapse
-
#==(other) ⇒ true, false
Default == operator.
-
#initialize(bold = false, italic = false, underlined = Underline.new(:none), strike = :none) ⇒ FontStyle
constructor
Default constructor.
-
#to_s ⇒ String
Default to_s operator.
Constructor Details
#initialize(bold = false, italic = false, underlined = Underline.new(:none), strike = :none) ⇒ FontStyle
Default constructor
22 23 24 25 26 27 |
# File 'lib/ooxml_parser/common_parser/common_data/font_style.rb', line 22 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 |
Instance Attribute Details
#bold ⇒ false, true
Returns is bold?.
8 9 10 |
# File 'lib/ooxml_parser/common_parser/common_data/font_style.rb', line 8 def bold @bold end |
#italic ⇒ false, true
Returns is bold?.
10 11 12 |
# File 'lib/ooxml_parser/common_parser/common_data/font_style.rb', line 10 def italic @italic end |
#strike ⇒ Strike
Returns strike type.
14 15 16 |
# File 'lib/ooxml_parser/common_parser/common_data/font_style.rb', line 14 def strike @strike end |
#underlined ⇒ Underline
Returns underline type.
12 13 14 |
# File 'lib/ooxml_parser/common_parser/common_data/font_style.rb', line 12 def underlined @underlined end |
Instance Method Details
#==(other) ⇒ true, false
Default == operator
31 32 33 |
# File 'lib/ooxml_parser/common_parser/common_data/font_style.rb', line 31 def ==(other) (@bold == other.bold) && (@italic == other.italic) && (@underlined == other.underlined) && (@strike == other.strike) end |
#to_s ⇒ String
Default to_s operator
37 38 39 |
# File 'lib/ooxml_parser/common_parser/common_data/font_style.rb', line 37 def to_s "Bold: #{@bold}, Italic: #{@italic}, Underlined: #{@underlined}, Strike: #{@strike}" end |