Class: Hexdump::Theme
- Inherits:
-
Object
- Object
- Hexdump::Theme
- Defined in:
- lib/hexdump/theme.rb,
lib/hexdump/theme/ansi.rb,
lib/hexdump/theme/rule.rb
Overview
Represents a hexdump theme (styling + highlighting).
Defined Under Namespace
Instance Attribute Summary collapse
-
#chars ⇒ Rule?
readonly
The chars styling/highlights.
-
#index ⇒ Rule?
readonly
The index styling/highlights.
-
#numeric ⇒ Rule?
readonly
The numeric styling/highlights.
Instance Method Summary collapse
-
#initialize(style: {}, highlights: {}) ⇒ Theme
constructor
Initializes the theme.
Constructor Details
#initialize(style: {}, highlights: {}) ⇒ Theme
Initializes the theme.
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/hexdump/theme.rb', line 43 def initialize(style: {}, highlights: {}) @index = Rule.new( style: style[:index], highlights: highlights[:index] ) @numeric = Rule.new( style: style[:numeric], highlights: highlights[:numeric] ) @chars = Rule.new( style: style[:chars], highlights: highlights[:chars] ) end |
Instance Attribute Details
#chars ⇒ Rule? (readonly)
The chars styling/highlights.
32 33 34 |
# File 'lib/hexdump/theme.rb', line 32 def chars @chars end |
#index ⇒ Rule? (readonly)
The index styling/highlights.
18 19 20 |
# File 'lib/hexdump/theme.rb', line 18 def index @index end |
#numeric ⇒ Rule? (readonly)
The numeric styling/highlights.
25 26 27 |
# File 'lib/hexdump/theme.rb', line 25 def numeric @numeric end |