Class: Rubycli::CLI::CommandCatalog

Inherits:
Struct
  • Object
show all
Defined in:
lib/rubycli/cli.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#alias_mapObject

Returns the value of attribute alias_map

Returns:

  • (Object)

    the current value of alias_map



13
14
15
# File 'lib/rubycli/cli.rb', line 13

def alias_map
  @alias_map
end

#duplicatesObject

Returns the value of attribute duplicates

Returns:

  • (Object)

    the current value of duplicates



13
14
15
# File 'lib/rubycli/cli.rb', line 13

def duplicates
  @duplicates
end

#entriesObject

Returns the value of attribute entries

Returns:

  • (Object)

    the current value of entries



13
14
15
# File 'lib/rubycli/cli.rb', line 13

def entries
  @entries
end

Instance Method Details

#commandsObject



22
23
24
# File 'lib/rubycli/cli.rb', line 22

def commands
  entries.map(&:command)
end

#entries_for(category) ⇒ Object



18
19
20
# File 'lib/rubycli/cli.rb', line 18

def entries_for(category)
  entries.select { |entry| entry.category == category }
end

#lookup(command) ⇒ Object



14
15
16
# File 'lib/rubycli/cli.rb', line 14

def lookup(command)
  alias_map[command]
end