Class: Dato::Link
Instance Attribute Summary
Attributes inherited from Node
#root
Instance Method Summary
collapse
Methods inherited from Node
#blocks, #debug_node, #links, #overrides, #render_node
Constructor Details
#initialize(node, root) ⇒ 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_tag ⇒ Object
8
9
10
|
# File 'app/components/dato/link.rb', line 8
def generated_tag
"a"
end
|
#link_attributes ⇒ Object
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] = (type) }
attr
end
|