Class: TwitterBootstrapMarkup::Help

Inherits:
Tag
  • Object
show all
Defined in:
lib/twitter_bootstrap_markup/help.rb

Constant Summary

Constants included from Popover

Popover::POSITIONS

Constants included from Tooltip

Tooltip::POSITIONS

Instance Attribute Summary

Attributes inherited from Tag

#attributes, #children, #name

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Tag

#append, #prepend, #to_s

Methods included from SidePosition

#pull_left, #pull_right

Methods included from Popover

#popover

Methods included from Tooltip

#tooltip

Constructor Details

#initialize(type, text) ⇒ Help

Returns a new instance of Help.



4
5
6
7
8
9
10
11
12
13
# File 'lib/twitter_bootstrap_markup/help.rb', line 4

def initialize(type, text)
  case type
    when :inline
      super(:span, text, :class => 'help-inline') {}
    when :block
      super(:p, text, :class => 'help-block') {}
    else
      raise "Invalid help type [#{type}]"
  end
end

Class Method Details

.block(text) ⇒ Object



19
20
21
# File 'lib/twitter_bootstrap_markup/help.rb', line 19

def self.block(text)
  self.new(:block, text)
end

.inline(text) ⇒ Object



15
16
17
# File 'lib/twitter_bootstrap_markup/help.rb', line 15

def self.inline(text)
  self.new(:inline, text)
end