Class: Shipyard::Jekyll::Alert

Inherits:
Liquid::Block
  • Object
show all
Includes:
AlertHelper
Defined in:
lib/shipyard-framework/jekyll/tags/alert_tag.rb

Instance Method Summary collapse

Methods included from AlertHelper

#flash_alert

Methods included from IconHelper

#icon

Constructor Details

#initialize(tag_name, params, options) ⇒ Alert

Returns a new instance of Alert.



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

def initialize(tag_name, params, options)
  super
  @params = params.strip.split(',').map(&:strip)
  @args = []
  @params.each do |param|
    if param.start_with?(':')
      @args << param.tr(':','').to_sym
    else
      @args << eval("{#{param}}")
    end
  end
end

Instance Method Details

#render(context) ⇒ Object



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

def render(context)
  flash_alert(*@args, super)
end