Class: Vic::Colorscheme::HighlightSet

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/vic/colorscheme/highlight_set.rb

Instance Method Summary collapse

Instance Method Details

#add(highlight) ⇒ Colorscheme::HighlightSet

Adds a highlight to the set.

Parameters:

Returns:



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

#eachObject



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

Parameters:

  • group (String)

    the group name

Returns:



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

#highlightsObject



5
6
7
# File 'lib/vic/colorscheme/highlight_set.rb', line 5

def highlights
  @highlights ||= []
end