Class: WebIDL::Ast::ScopedName
- Defined in:
- lib/webidl/ast/scoped_name.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(parent, name, opts = {}) ⇒ ScopedName
constructor
A new instance of ScopedName.
- #qualified_name ⇒ Object
- #relative? ⇒ Boolean
Methods inherited from Node
Constructor Details
#initialize(parent, name, opts = {}) ⇒ ScopedName
Returns a new instance of ScopedName.
7 8 9 10 11 12 |
# File 'lib/webidl/ast/scoped_name.rb', line 7 def initialize(parent, name, opts = {}) super(parent) @name = name @relative = !!opts[:relative] end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/webidl/ast/scoped_name.rb', line 5 def name @name end |
Instance Method Details
#qualified_name ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/webidl/ast/scoped_name.rb', line 14 def qualified_name if relative? && @parent "#{@parent.qualified_name}::#{@name}" else "::#{@name}" end end |
#relative? ⇒ Boolean
22 23 24 |
# File 'lib/webidl/ast/scoped_name.rb', line 22 def relative? @relative end |