Sha256: 523f0e2744fc294b94ade05ccd8f7798a70a7c85c3fb9ba922921f30718c8d87

Contents?: true

Size: 935 Bytes

Versions: 4

Compression:

Stored size: 935 Bytes

Contents

module WebIDL
  module Ast
    class Operation < Node

      attr_reader :type, :name, :args, :specials, :raises
      attr_accessor :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]   || []
      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 caller?
        @specials.include? 'caller'
      end

      def static?
        !!@static
      end

    end # Operation
  end # Ast
end # WebIDL

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
webidl-0.1.2 lib/webidl/ast/operation.rb
webidl-0.1.1 lib/webidl/ast/operation.rb
webidl-0.1.0 lib/webidl/ast/operation.rb
webidl-0.0.9 lib/webidl/ast/operation.rb