Class: Storyblok::Richtext::Nodes::Blok

Inherits:
Node
  • Object
show all
Defined in:
lib/storyblok/richtext/html_renderer/nodes/blok.rb

Instance Attribute Summary

Attributes inherited from Node

#type, #wrapper

Instance Method Summary collapse

Methods inherited from Node

#initialize, #single_tag, #tag, #text

Constructor Details

This class inherits a constructor from Storyblok::Richtext::Nodes::Node

Instance Method Details

#component_resolver(component, data) ⇒ Object



17
18
19
# File 'lib/storyblok/richtext/html_renderer/nodes/blok.rb', line 17

def component_resolver component, data
  ''
end

#htmlObject



9
10
11
12
13
14
15
# File 'lib/storyblok/richtext/html_renderer/nodes/blok.rb', line 9

def html
  body = ''
  @node['attrs']['body'].each do |blok|
    body += component_resolver(blok['component'], blok)
  end
  body
end

#matchingObject



5
6
7
# File 'lib/storyblok/richtext/html_renderer/nodes/blok.rb', line 5

def matching
  @node['type'] === 'blok'
end