Class: Olivander::Menus::Badge

Inherits:
Object
  • Object
show all
Defined in:
lib/olivander/menus/menu_item.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(text = nil, badge_class = nil) ⇒ Badge

Returns a new instance of Badge.



92
93
94
95
# File 'lib/olivander/menus/menu_item.rb', line 92

def initialize(text = nil, badge_class = nil)
  @text = text
  @badge_class = badge_class
end

Instance Attribute Details

#badge_classObject

Returns the value of attribute badge_class.



90
91
92
# File 'lib/olivander/menus/menu_item.rb', line 90

def badge_class
  @badge_class
end

#textObject

Returns the value of attribute text.



90
91
92
# File 'lib/olivander/menus/menu_item.rb', line 90

def text
  @text
end

Instance Method Details

#with_proc {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



97
98
99
100
# File 'lib/olivander/menus/menu_item.rb', line 97

def with_proc
  yield(self)
  self
end