Class: ObjectView::Link

Inherits:
Element
  • Object
show all
Defined in:
lib/object_view/link.rb

Instance Attribute Summary

Attributes inherited from Element

#acceptable_children, #children, #single_line, #tag

Instance Method Summary collapse

Methods inherited from Element

#<<, #add, #add_with_tag, #attr, #attributes, #css_class=, #find_element_with_tag, #id=, #is_acceptable_child?, #on_click=, #render, #render_attributes, #render_children, #style, #style=

Constructor Details

#initialize(href = nil, label = nil) ⇒ Link

Returns a new instance of Link.



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/object_view/link.rb', line 5

def initialize(href = nil, label = nil)
  super()
  @tag = "a"
  
  if (href != nil)
    self.attr("href", href)
  end
  
  if (label != nil)
    self.add label
  end
end