Class: Trestle::Navigation::Item::Badge

Inherits:
Object
  • Object
show all
Defined in:
lib/trestle/navigation/item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Badge

Returns a new instance of Badge.



92
93
94
95
96
97
98
99
100
# File 'lib/trestle/navigation/item.rb', line 92

def initialize(options)
  case options
  when Hash
    @html_class = options[:class]
    @text = options[:text]
  else
    @text = options
  end
end

Instance Attribute Details

#textObject (readonly)

Returns the value of attribute text.



90
91
92
# File 'lib/trestle/navigation/item.rb', line 90

def text
  @text
end

Instance Method Details

#html_classObject



102
103
104
# File 'lib/trestle/navigation/item.rb', line 102

def html_class
  @html_class || "badge-primary"
end