Class: Jekyll::Tabs::TabsBlock
- Inherits:
-
Liquid::Block
- Object
- Liquid::Block
- Jekyll::Tabs::TabsBlock
- Defined in:
- lib/jekyll-tabs.rb
Instance Method Summary collapse
-
#initialize(block_name, markup, tokens) ⇒ TabsBlock
constructor
A new instance of TabsBlock.
- #render(context) ⇒ Object
Constructor Details
#initialize(block_name, markup, tokens) ⇒ TabsBlock
Returns a new instance of TabsBlock.
14 15 16 17 18 19 20 21 |
# File 'lib/jekyll-tabs.rb', line 14 def initialize(block_name, markup, tokens) super if markup == '' raise SyntaxError.new("Block #{block_name} requires 1 attribute") end @name = sanitizeName(markup) end |
Instance Method Details
#render(context) ⇒ Object
23 24 25 26 27 28 29 30 31 32 |
# File 'lib/jekyll-tabs.rb', line 23 def render(context) environment = context.environments.first super uuid = SecureRandom.uuid currentDirectory = File.dirname(__FILE__) templateFile = File.read(currentDirectory + '/template.erb') template = ERB.new(templateFile) template.result(binding) end |