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.



71
72
73
74
75
76
77
78
79
# File 'lib/trestle/navigation/item.rb', line 71

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.



69
70
71
# File 'lib/trestle/navigation/item.rb', line 69

def text
  @text
end

Instance Method Details

#html_classObject



81
82
83
# File 'lib/trestle/navigation/item.rb', line 81

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