Sha256: 1332b0edceefe0123c0426392e666d9b1058dff3ca1da4d89a2427bed57c8668

Contents?: true

Size: 532 Bytes

Versions: 6

Compression:

Stored size: 532 Bytes

Contents

module Mutant
  module AST
    # Node meta information mixin
    module Meta

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

        UNDERSCORE = '_'.freeze

        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

6 entries across 6 versions & 1 rubygems

Version Path
mutant-0.8.16 lib/mutant/ast/meta/optarg.rb
mutant-0.8.15 lib/mutant/ast/meta/optarg.rb
mutant-0.8.14 lib/mutant/ast/meta/optarg.rb
mutant-0.8.13 lib/mutant/ast/meta/optarg.rb
mutant-0.8.12 lib/mutant/ast/meta/optarg.rb
mutant-0.8.11 lib/mutant/ast/meta/optarg.rb