Class: Shipyard::Jekyll::Button

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

Instance Method Summary collapse

Methods included from ButtonHelper

#btn

Constructor Details

#initialize(tag_name, params, options) ⇒ Button

Returns a new instance of Button.



8
9
10
11
12
13
14
# File 'lib/shipyard-framework/jekyll/tags/button_tag.rb', line 8

def initialize(tag_name, params, options)
  super
  @params = params.split(',')
  @text = @params[0].strip
  @args = @params[1].to_s.tr(':','').split(' ').map(&:to_sym)
  @args << eval("{#{@params[2]}}") if @params[2]
end

Instance Method Details

#render(context) ⇒ Object



16
17
18
# File 'lib/shipyard-framework/jekyll/tags/button_tag.rb', line 16

def render(context)
  btn @text, *@args
end