Class: WebIDL::Ast::Argument

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

Instance Attribute Summary collapse

Attributes inherited from Node

#parent

Instance Method Summary collapse

Methods inherited from Node

#accept, #qualified_name, #snake_name

Constructor Details

#initialize(name, type, opts = {}) ⇒ Argument

Returns a new instance of Argument.



7
8
9
10
11
12
13
14
# File 'lib/webidl/ast/argument.rb', line 7

def initialize(name, type, opts = {})
  @name = name
  @type = type

  @optional = !!opts[:optional]
  @variadic = !!opts[:variadic]
  @extended_attributes = opts[:extended_attributes] || []
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



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

def name
  @name
end

#typeObject (readonly)

Returns the value of attribute type.



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

def type
  @type
end

Instance Method Details

#optional?Boolean

Returns:

  • (Boolean)


16
17
18
# File 'lib/webidl/ast/argument.rb', line 16

def optional?
  @optional
end

#variadic?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/webidl/ast/argument.rb', line 20

def variadic?
  @variadic
end