Sha256: e7522749f9d2043eaded4e163b7fd2770a5dba153caa33d7c4d2e67bc3efbe0a

Contents?: true

Size: 329 Bytes

Versions: 3

Compression:

Stored size: 329 Bytes

Contents

module Memo
  class Option
    attr_reader :namespace

    def initialize(args)
      @args = args.to_a

      case args
      in [*, "-n", namespace, *]
        @namespace = namespace
        @args.delete("-n")
        @args.delete(namespace)
      else
      end
    end

    def [](index)
      @args[index]
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ememo-0.1.4 lib/memo/cli/arg/option.rb
ememo-0.1.3 lib/memo/cli/arg/option.rb
ememo-0.1.2 lib/memo/cli/arg/option.rb