Sha256: 8af05cf6fea2e5560b6c5717b68c549dd04ec84d8d68e7dad328aaeb77878b8e

Contents?: true

Size: 556 Bytes

Versions: 59

Compression:

Stored size: 556 Bytes

Contents

# frozen_string_literal: true

module Mutant
  module AST
    # Node meta information mixin
    module Meta

      # Metadata for optional argument nodes
      class Optarg
        include NamedChildren, Concord.new(:node)

        UNDERSCORE = '_'

        children :name, :default_value

        public :name, :default_value

        # Test if optarg definition intends to be used
        #
        # @return [Boolean]
        def used?
          !name.to_s.start_with?(UNDERSCORE)
        end
      end # Optarg

    end # Meta
  end # AST
end # Mutant

Version data entries

59 entries across 59 versions & 1 rubygems

Version Path
mutant-0.11.8 lib/mutant/ast/meta/optarg.rb
mutant-0.11.7 lib/mutant/ast/meta/optarg.rb
mutant-0.11.6 lib/mutant/ast/meta/optarg.rb
mutant-0.11.5 lib/mutant/ast/meta/optarg.rb
mutant-0.11.4 lib/mutant/ast/meta/optarg.rb
mutant-0.11.3 lib/mutant/ast/meta/optarg.rb
mutant-0.11.2 lib/mutant/ast/meta/optarg.rb
mutant-0.11.1 lib/mutant/ast/meta/optarg.rb
mutant-0.11.0 lib/mutant/ast/meta/optarg.rb
mutant-0.10.35 lib/mutant/ast/meta/optarg.rb
mutant-0.10.34 lib/mutant/ast/meta/optarg.rb
mutant-0.10.33 lib/mutant/ast/meta/optarg.rb
mutant-0.10.32 lib/mutant/ast/meta/optarg.rb
mutant-0.10.31 lib/mutant/ast/meta/optarg.rb
mutant-0.10.30 lib/mutant/ast/meta/optarg.rb
mutant-0.10.29 lib/mutant/ast/meta/optarg.rb
mutant-0.10.28 lib/mutant/ast/meta/optarg.rb
mutant-0.10.27 lib/mutant/ast/meta/optarg.rb
mutant-0.10.26 lib/mutant/ast/meta/optarg.rb
mutant-0.10.25 lib/mutant/ast/meta/optarg.rb