Class: Shipyard::Jekyll::Button
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- Shipyard::Jekyll::Button
- Includes:
- ButtonHelper
- Defined in:
- lib/shipyard-framework/jekyll/button_tag.rb
Instance Method Summary collapse
-
#initialize(tag_name, params, options) ⇒ Button
constructor
A new instance of Button.
- #render(context) ⇒ Object
Methods included from ButtonHelper
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/button_tag.rb', line 8 def initialize(tag_name, params, ) super @params = params.split(',') @text = @params[0] @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/button_tag.rb', line 16 def render(context) btn @text, *@args end |