Sha256: 314c3c04ef6a5e81da26abac11ca8bb55ee0d501413047aae7196f4fcf4ff07a

Contents?: true

Size: 1.13 KB

Versions: 3

Compression:

Stored size: 1.13 KB

Contents

module WebIDL
  module Ast
    class Operation < Node

      attr_reader :type, :name, :args, :specials, :raises
      attr_accessor :extended_attributes, :stringifier

      def initialize(parent, type, opts = {})
        @parent              = parent
        @type                = type
        @name                = opts[:name]                || ''
        @static              = opts[:static]
        @specials            = opts[:specials]            || []
        @args                = opts[:args]                || []
        @raises              = opts[:raises]              || []
        @extended_attributes = opts[:extended_attributes] || []
      end

      def stringifier?
        !!@stringifier
      end

      def getter?
        @specials.include? 'getter'
      end

      def setter?
        @specials.include? 'setter'
      end

      def creator?
        @specials.include? 'creator'
      end

      def deleter?
        @specials.include? 'deleter'
      end

      def legacycaller?
        @specials.include? 'legacycaller'
      end

      def static?
        !!@static
      end

    end # Operation
  end # Ast
end # WebIDL

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
webidl-0.2.2 lib/webidl/ast/operation.rb
webidl-0.2.1 lib/webidl/ast/operation.rb
webidl-0.1.10 lib/webidl/ast/operation.rb