Class: Shipyard::Jekyll::Icon

Inherits:
Liquid::Tag
  • Object
show all
Includes:
IconHelper
Defined in:
lib/shipyard-framework/jekyll/tags/icon_tag.rb

Instance Method Summary collapse

Methods included from IconHelper

#icon

Constructor Details

#initialize(tag_name, params, options) ⇒ Icon

Returns a new instance of Icon.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/shipyard-framework/jekyll/tags/icon_tag.rb', line 8

def initialize(tag_name, params, options)
  super
  @options = {}
  params.strip.split(',').each_with_index do |arg, index|
    if index == 0
      @name = eval(arg)
    else
      @options.merge!(eval("{#{arg}}"))
    end
  end
end

Instance Method Details

#render(context) ⇒ Object



20
21
22
# File 'lib/shipyard-framework/jekyll/tags/icon_tag.rb', line 20

def render(context)
  icon @name, @options
end