Sha256: 8e01fc61bbcfa1ee4161ab508cfed626082949ad93dfffaa0dba109f06c9505f
Contents?: true
Size: 445 Bytes
Versions: 18
Compression:
Stored size: 445 Bytes
Contents
module Clamp class Subcommand < Struct.new(:name, :description, :subcommand_class) def initialize(names, description, subcommand_class) @names = Array(names) @description = description @subcommand_class = subcommand_class end attr_reader :names, :description, :subcommand_class def is_called?(name) names.member?(name) end def help [names.join(", "), description] end end end
Version data entries
18 entries across 18 versions & 3 rubygems