Class: Dato::Link

Inherits:
DastNode show all
Defined in:
app/components/dato/link.rb

Instance Attribute Summary

Attributes inherited from Node

#root

Instance Method Summary collapse

Methods inherited from Node

#blocks, #debug_node, #overrides, #render_node

Constructor Details

#initialize(node, root) ⇒ Link

Returns a new instance of Link.



4
5
6
# File 'app/components/dato/link.rb', line 4

def initialize(node, root)
  super(node, "link", root)
end

Instance Method Details

#generated_tagObject



8
9
10
# File 'app/components/dato/link.rb', line 8

def generated_tag
  "a"
end


12
13
14
15
16
17
18
19
# File 'app/components/dato/link.rb', line 12

def link_attributes
  attr = {
    "href" => @node.url,
    "class" => "dato-cms-#{@node.type}",
  }
  %w[rel target].each { |type| attr[type] = extract_meta(type) }
  attr
end