Class: Opswatch::IconPack

Inherits:
Object
  • Object
show all
Defined in:
lib/icon_pack.rb

Instance Method Summary collapse

Constructor Details

#initialize(stack_name, icon_paths = nil) ⇒ IconPack

Returns a new instance of IconPack.



7
8
9
10
11
# File 'lib/icon_pack.rb', line 7

def initialize(stack_name, icon_paths = nil)
  icon_paths = icon_paths || %w[hold negative off positive].map { |base_icon| [base_icon, "#{GEM_ROOT}/icons/#{base_icon}.png"] }.to_h
  @stack_name = stack_name
  @file_paths = generate_icons(icon_paths)
end

Instance Method Details

#fetch(key) ⇒ Object



13
14
15
# File 'lib/icon_pack.rb', line 13

def fetch(key)
  @file_paths[key].path
end