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 |
# File 'lib/webidl/ast/argument.rb', line 7 def initialize(name, type, opts = {}) @name = name @type = type @optional = !!opts[:optional] @variadic = !!opts[:variadic] 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
15 16 17 |
# File 'lib/webidl/ast/argument.rb', line 15 def optional? @optional end |
#variadic? ⇒ Boolean
19 20 21 |
# File 'lib/webidl/ast/argument.rb', line 19 def variadic? @variadic end |