Method: Basicons::Basicon#initialize
- Defined in:
- lib/basicons/basicon.rb
#initialize(symbol, options = {}) ⇒ Basicon
Returns a new instance of Basicon.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/basicons/basicon.rb', line 12 def initialize(symbol, = {}) @symbol = symbol.to_s = .dup if @data = Basicons::SVG_DATA[@symbol] .merge!({ class: classes, width: svg_size, height: svg_size, viewBox: '0 0 24 24', stroke: 'currentColor', fill: 'none' }) .delete(:size) ['stroke-width'] = 2 ['stroke-linecap'] = 'round' ['stroke-linejoin'] = 'round' ['xmlns'] = 'http://www.w3.org/2000/svg' else raise "<#{@symbol}> not found" end end |