Class: WebIDL::Ast::Type
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #array! ⇒ Object
-
#initialize(parent, name, opts = {}) ⇒ Type
constructor
A new instance of Type.
- #nullable? ⇒ Boolean
Methods inherited from Node
#accept, #qualified_name, #snake_name
Constructor Details
#initialize(parent, name, opts = {}) ⇒ Type
Returns a new instance of Type.
7 8 9 10 11 12 |
# File 'lib/webidl/ast/type.rb', line 7 def initialize(parent, name, opts = {}) super(parent) @name = camel_case_type(name.strip).to_sym @nullable = !!opts[:nullable] end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/webidl/ast/type.rb', line 5 def name @name end |
Instance Method Details
#array! ⇒ Object
18 19 20 |
# File 'lib/webidl/ast/type.rb', line 18 def array! @name = "#{@name}Array".to_sym end |
#nullable? ⇒ Boolean
14 15 16 |
# File 'lib/webidl/ast/type.rb', line 14 def nullable? @nullable end |