Class: WebIDL::Ast::Operation

Inherits:
Node
  • Object
show all
Defined in:
lib/webidl/ast/operation.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#accept, #qualified_name, #snake_name

Constructor Details

#initialize(parent, type, opts = {}) ⇒ Operation

Returns a new instance of Operation.



8
9
10
11
12
13
14
15
16
# File 'lib/webidl/ast/operation.rb', line 8

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

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



5
6
7
# File 'lib/webidl/ast/operation.rb', line 5

def args
  @args
end

#nameObject (readonly)

Returns the value of attribute name.



5
6
7
# File 'lib/webidl/ast/operation.rb', line 5

def name
  @name
end

#raisesObject (readonly)

Returns the value of attribute raises.



5
6
7
# File 'lib/webidl/ast/operation.rb', line 5

def raises
  @raises
end

#specialsObject (readonly)

Returns the value of attribute specials.



5
6
7
# File 'lib/webidl/ast/operation.rb', line 5

def specials
  @specials
end

#stringifierObject

Returns the value of attribute stringifier.



6
7
8
# File 'lib/webidl/ast/operation.rb', line 6

def stringifier
  @stringifier
end

#typeObject (readonly)

Returns the value of attribute type.



5
6
7
# File 'lib/webidl/ast/operation.rb', line 5

def type
  @type
end

Instance Method Details

#creator?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/webidl/ast/operation.rb', line 30

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

#deleter?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/webidl/ast/operation.rb', line 34

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

#getter?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/webidl/ast/operation.rb', line 22

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

#legacycaller?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/webidl/ast/operation.rb', line 38

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

#setter?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/webidl/ast/operation.rb', line 26

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

#static?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/webidl/ast/operation.rb', line 42

def static?
  !!@static
end

#stringifier?Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/webidl/ast/operation.rb', line 18

def stringifier?
  !!@stringifier
end