Class: JekyllBlocker::MenuTag
- Inherits:
-
Liquid::Tag
- Object
- Liquid::Tag
- JekyllBlocker::MenuTag
- Defined in:
- lib/jekyll-blocker/tags/menu_tag.rb
Instance Method Summary collapse
-
#initialize(tag_name, params, parse_context) ⇒ MenuTag
constructor
A new instance of MenuTag.
- #render(context) ⇒ Object
Constructor Details
#initialize(tag_name, params, parse_context) ⇒ MenuTag
Returns a new instance of MenuTag.
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/jekyll-blocker/tags/menu_tag.rb', line 3 def initialize(tag_name, params, parse_context) super parts = params.to_s.strip.split.compact if parts.count == 2 @name = parts.first.strip @style = parts.last.strip else raise Liquid::SyntaxError, "menu tag expects 2 arguments, #{parts.count} given" end end |
Instance Method Details
#render(context) ⇒ Object
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/jekyll-blocker/tags/menu_tag.rb', line 15 def render(context) @context = context @style = parse_param(@style) = ((@name)) if style_wrapper = render_part(style_wrapper, { "content" => }) end end |