Class: Coco::IconSprite
- Inherits:
-
Object
- Object
- Coco::IconSprite
- Includes:
- ActionView::Helpers::TagHelper
- Defined in:
- lib/coco/icon_sprite.rb
Instance Method Summary collapse
-
#initialize(icons = []) ⇒ IconSprite
constructor
A new instance of IconSprite.
- #to_svg ⇒ Object
Constructor Details
#initialize(icons = []) ⇒ IconSprite
Returns a new instance of IconSprite.
5 6 7 8 |
# File 'lib/coco/icon_sprite.rb', line 5 def initialize(icons = []) @icons = icons @icons.freeze end |
Instance Method Details
#to_svg ⇒ Object
10 11 12 13 14 |
# File 'lib/coco/icon_sprite.rb', line 10 def to_svg tag.svg xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 24 24" do ("\n" + symbols.join("\n ") + "\n").html_safe end end |