Class: Vic::Colorscheme::HighlightSet
- Inherits:
-
Object
- Object
- Vic::Colorscheme::HighlightSet
- Includes:
- Enumerable
- Defined in:
- lib/vic/colorscheme/highlight_set.rb
Instance Method Summary collapse
-
#add(highlight) ⇒ Colorscheme::HighlightSet
Adds a highlight to the set.
- #each ⇒ Object
-
#find_by_group(group) ⇒ Colorscheme::Highlight?
Find a highlight by group name.
- #highlights ⇒ Object
Instance Method Details
#add(highlight) ⇒ Colorscheme::HighlightSet
Adds a highlight to the set.
17 18 19 20 21 22 23 24 |
# File 'lib/vic/colorscheme/highlight_set.rb', line 17 def add(highlight) if highlight.respond_to? :gui highlights.push highlight else # Raise and Exception raise TypeError.new("expected type Colorscheme::Vic::Highlight") end end |
#each ⇒ Object
9 10 11 |
# File 'lib/vic/colorscheme/highlight_set.rb', line 9 def each highlights.each {|h| yield h } end |
#find_by_group(group) ⇒ Colorscheme::Highlight?
Find a highlight by group name
30 31 32 |
# File 'lib/vic/colorscheme/highlight_set.rb', line 30 def find_by_group(group) find {|h| h.group == group.to_sym } end |
#highlights ⇒ Object
5 6 7 |
# File 'lib/vic/colorscheme/highlight_set.rb', line 5 def highlights @highlights ||= [] end |