Class: Storyblok::Richtext::Nodes::Image

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

Instance Attribute Summary

Attributes inherited from Node

#type, #wrapper

Instance Method Summary collapse

Methods inherited from Node

#html, #initialize, #tag, #text

Constructor Details

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

Instance Method Details

#matchingObject



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

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

#single_tagObject



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

def single_tag
  [{
    tag: "img",
    attrs: @node['attrs'].slice('src', 'alt', 'title')
  }]
end