Sha256: 6c9d90138caafcb14f016a74c403143431db53464114395789ef5ed95ac3d91d

Contents?: true

Size: 584 Bytes

Versions: 1

Compression:

Stored size: 584 Bytes

Contents

module TrelloCli
  module CLI
    module Commands
      module Shared

        def actions(obj = self)
          (obj.methods - obj.class.superclass.instance_methods).sort - shared_methods
        end

        def shared_methods
          TrelloCli::CLI::Commands::Shared.instance_methods
        end

        def target_name
          self.class.name.downcase.split('::').last
        end

        def help
          puts "Valid commands for #{target_name}: #{actions.join(', ')}"
          puts "For further help, append -h to sub command."
        end

      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
trello_cli-0.0.3 lib/trello_cli/cli/commands/shared.rb