Sha256: 1cbda3f9858d216981b23566d665c6ccbfc5e542524fcd3867901d30db3d5939

Contents?: true

Size: 481 Bytes

Versions: 6

Compression:

Stored size: 481 Bytes

Contents

require 'set'

class Thor
  # A {Thor::Option} that has an additional {#groups} attribute storing a
  # set of group symbols that the option is a part of.
  # 
  class SharedOption < Option
    
    # Shared option groups this option belongs to.
    # 
    # @return [Set<Symbol>]
    #     
    attr_reader :groups
    
    # 
    # 
    def initialize name, **options
      super name, options
      
      @groups = Set.new [*options[:groups]].map( &:to_sym )
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
atli-0.1.7 lib/thor/parser/shared_option.rb
atli-0.1.6 lib/thor/parser/shared_option.rb
atli-0.1.5 lib/thor/parser/shared_option.rb
atli-0.1.4 lib/thor/parser/shared_option.rb
atli-0.1.3 lib/thor/parser/shared_option.rb
atli-0.1.2 lib/thor/parser/shared_option.rb