Class: TwitterBootstrapMarkup::LinkButton

Inherits:
Tag
  • Object
show all
Includes:
ButtonBase
Defined in:
lib/twitter_bootstrap_markup/link_button.rb

Constant Summary

Constants included from ButtonBase

ButtonBase::SIZES, ButtonBase::TYPES

Constants included from Popover

Popover::POSITIONS

Constants included from Tooltip

Tooltip::POSITIONS

Instance Attribute Summary

Attributes inherited from Tag

#attributes, #children, #name

Instance Method Summary collapse

Methods included from ButtonBase

included

Methods inherited from Tag

#append, block, inline, #prepend, #to_s

Methods included from SidePosition

#pull_left, #pull_right

Methods included from Popover

#popover

Methods included from Tooltip

#tooltip

Constructor Details

#initialize(*args, &block) ⇒ LinkButton

Returns a new instance of LinkButton.



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

def initialize(*args, &block)
  text = args.shift unless block_given?
  url = args.shift
  attributes = args.shift || {}

  if block_given?
    super(:a, attributes.prepend!(:class, 'btn').merge(:href => url), &block)
  else
    super(:a, text, attributes.prepend!(:class, 'btn').merge(:href => url)) {}
  end
end