Sha256: cbb3dbb24ff0a6af494f33f8a738fc8ec00f1e4de9104490e7a7a437d02a14ba

Contents?: true

Size: 545 Bytes

Versions: 15

Compression:

Stored size: 545 Bytes

Contents

module WebIDL
  module Ast
    class Node

      def initialize(parent = nil)
        @parent = parent
      end

      def qualified_name
        return unless @name

        if @parent.respond_to?(:qualified_name)
          "#{@parent.qualified_name}::#{@name}"
        else
          "::#{@name}"
        end
      end

      def accept(visitor, &blk)
        visitor.send("visit_#{snake_name}", self, &blk)
      end

      def snake_name
        self.class.name.split("::").last.snake_case
      end

    end # Node
  end # Ast
end # WebIDL

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
webidl-0.1.5 lib/webidl/ast/node.rb
webidl-0.1.4 lib/webidl/ast/node.rb
webidl-0.1.3 lib/webidl/ast/node.rb
webidl-0.1.2 lib/webidl/ast/node.rb
webidl-0.1.1 lib/webidl/ast/node.rb
webidl-0.1.0 lib/webidl/ast/node.rb
webidl-0.0.9 lib/webidl/ast/node.rb
webidl-0.0.8 lib/webidl/ast/node.rb
webidl-0.0.7 lib/webidl/ast/node.rb
webidl-0.0.6 lib/webidl/ast/node.rb
webidl-0.0.5 lib/webidl/ast/node.rb
webidl-0.0.4 lib/webidl/ast/node.rb
webidl-0.0.3 lib/webidl/ast/node.rb
webidl-0.0.2 lib/webidl/ast/node.rb
webidl-0.0.1 lib/webidl/ast/node.rb