Module: DatoDast::Nodes

Defined in:
lib/dato_dast/nodes.rb,
lib/dato_dast/nodes/base.rb,
lib/dato_dast/nodes/code.rb,
lib/dato_dast/nodes/item.rb,
lib/dato_dast/nodes/link.rb,
lib/dato_dast/nodes/list.rb,
lib/dato_dast/nodes/root.rb,
lib/dato_dast/nodes/span.rb,
lib/dato_dast/nodes/block.rb,
lib/dato_dast/nodes/generic.rb,
lib/dato_dast/nodes/heading.rb,
lib/dato_dast/nodes/item_link.rb,
lib/dato_dast/nodes/list_item.rb,
lib/dato_dast/nodes/paragraph.rb,
lib/dato_dast/nodes/blockquote.rb,
lib/dato_dast/nodes/inline_item.rb,
lib/dato_dast/nodes/thematic_break.rb,
lib/dato_dast/nodes/attributed_quote.rb

Defined Under Namespace

Classes: AttributedQuote, Base, Block, Blockquote, Code, Generic, Heading, InlineItem, Item, ItemLink, Link, List, ListItem, Paragraph, Root, Span, ThematicBreak

Class Method Summary collapse

Class Method Details

.wrap(value, links = [], blocks = [], config = nil) ⇒ Object



23
24
25
26
27
28
# File 'lib/dato_dast/nodes.rb', line 23

def self.wrap(value, links = [], blocks = [], config = nil)
  type = value["type"]
  configuration = config || DatoDast.configuration
  node_class = value["node"] || configuration.types[type]["node"]
  node_class.new(value, links, blocks, config)
end