Class: Git::Switcher::Submenu

Inherits:
Struct
  • Object
show all
Defined in:
lib/git/switcher/menu.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#labelObject

Returns the value of attribute label

Returns:

  • (Object)

    the current value of label



4
5
6
# File 'lib/git/switcher/menu.rb', line 4

def label
  @label
end

Returns the value of attribute menu_items

Returns:

  • (Object)

    the current value of menu_items



4
5
6
# File 'lib/git/switcher/menu.rb', line 4

def menu_items
  @menu_items
end

Instance Method Details

#to_sObject



5
6
7
8
# File 'lib/git/switcher/menu.rb', line 5

def to_s
  header = Rainbow(label).steelblue
  "\n\t#{header}\n\n" + menu_items.join("\n")
end