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.
7 8 9 10 11 12 13 |
# File 'lib/jekyll-tabs.rb', line 7 def initialize(block_name, markup, tokens) super if markup == '' raise SyntaxError.new("Block #{block_name} requires 1 attribute") end @name = markup.strip end |
Instance Method Details
#render(context) ⇒ Object
15 16 17 18 19 20 21 22 23 24 |
# File 'lib/jekyll-tabs.rb', line 15 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 |