Class: AsciinemaWin::AnsiParser::StyledChar
- Inherits:
-
Data
- Object
- Data
- AsciinemaWin::AnsiParser::StyledChar
- Defined in:
- lib/asciinema_win/ansi_parser.rb
Overview
Character with style information
Instance Attribute Summary collapse
-
#bg ⇒ Object
readonly
Returns the value of attribute bg.
-
#bold ⇒ Object
readonly
Returns the value of attribute bold.
-
#char ⇒ Object
readonly
Returns the value of attribute char.
-
#fg ⇒ Object
readonly
Returns the value of attribute fg.
-
#italic ⇒ Object
readonly
Returns the value of attribute italic.
-
#strikethrough ⇒ Object
readonly
Returns the value of attribute strikethrough.
-
#underline ⇒ Object
readonly
Returns the value of attribute underline.
Instance Method Summary collapse
-
#default_style? ⇒ Boolean
Check if this character has default styling.
-
#same_style?(other) ⇒ Boolean
Check if style matches another character.
Instance Attribute Details
#bg ⇒ Object (readonly)
Returns the value of attribute bg
10 11 12 |
# File 'lib/asciinema_win/ansi_parser.rb', line 10 def bg @bg end |
#bold ⇒ Object (readonly)
Returns the value of attribute bold
10 11 12 |
# File 'lib/asciinema_win/ansi_parser.rb', line 10 def bold @bold end |
#char ⇒ Object (readonly)
Returns the value of attribute char
10 11 12 |
# File 'lib/asciinema_win/ansi_parser.rb', line 10 def char @char end |
#fg ⇒ Object (readonly)
Returns the value of attribute fg
10 11 12 |
# File 'lib/asciinema_win/ansi_parser.rb', line 10 def fg @fg end |
#italic ⇒ Object (readonly)
Returns the value of attribute italic
10 11 12 |
# File 'lib/asciinema_win/ansi_parser.rb', line 10 def italic @italic end |
#strikethrough ⇒ Object (readonly)
Returns the value of attribute strikethrough
10 11 12 |
# File 'lib/asciinema_win/ansi_parser.rb', line 10 def strikethrough @strikethrough end |
#underline ⇒ Object (readonly)
Returns the value of attribute underline
10 11 12 |
# File 'lib/asciinema_win/ansi_parser.rb', line 10 def underline @underline end |
Instance Method Details
#default_style? ⇒ Boolean
Check if this character has default styling
14 15 16 |
# File 'lib/asciinema_win/ansi_parser.rb', line 14 def default_style? fg.nil? && bg.nil? && !bold && !italic && !underline && !strikethrough end |
#same_style?(other) ⇒ Boolean
Check if style matches another character
22 23 24 25 26 27 28 29 |
# File 'lib/asciinema_win/ansi_parser.rb', line 22 def same_style?(other) fg == other.fg && bg == other.bg && bold == other.bold && italic == other.italic && underline == other.underline && strikethrough == other.strikethrough end |