Class: WebIDL::Ast::Argument
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(name, type, opts = {}) ⇒ Argument
constructor
A new instance of Argument.
- #optional? ⇒ Boolean
- #variadic? ⇒ Boolean
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
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/webidl/ast/argument.rb', line 5 def name @name end |
#type ⇒ Object (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
16 17 18 |
# File 'lib/webidl/ast/argument.rb', line 16 def optional? @optional end |
#variadic? ⇒ Boolean
20 21 22 |
# File 'lib/webidl/ast/argument.rb', line 20 def variadic? @variadic end |