Sha256: 1af74e612c1f7c259a1748d6209f845629d2fab51a1920b3f179152df470e120

Contents?: true

Size: 389 Bytes

Versions: 3

Compression:

Stored size: 389 Bytes

Contents

module PLang
  module Parser
    class Node
      attr_reader :type
      def initialize(type, params)
        @type = type
        @params = params
      end

      def method_missing(name, *args)
        return @params[name]
      end

      def inspect
        ret = [@type]
        @params.each do |id, value|
          ret << value
        end
        ret
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
p-lang-0.3.1 lib/parser/node.rb
p-lang-0.3.0 lib/parser/node.rb
p-lang-0.2.0 lib/parser/node.rb