Class: IDL::Expression::ScopedName
- Inherits:
-
IDL::Expression
- Object
- IDL::Expression
- IDL::Expression::ScopedName
- Defined in:
- lib/ridl/expression.rb
Instance Attribute Summary collapse
-
#node ⇒ Object
readonly
Returns the value of attribute node.
Attributes inherited from IDL::Expression
Instance Method Summary collapse
-
#initialize(node) ⇒ ScopedName
constructor
A new instance of ScopedName.
- #instantiate(instantiation_context) ⇒ Object
- #is_node?(node_class) ⇒ Boolean
- #is_template? ⇒ Boolean
- #resolved_node ⇒ Object
Methods inherited from IDL::Expression
Constructor Details
#initialize(node) ⇒ ScopedName
Returns a new instance of ScopedName.
40 41 42 43 44 45 46 47 48 49 |
# File 'lib/ridl/expression.rb', line 40 def initialize(node) if $DEBUG unless IDL::AST::Const === node || (IDL::AST::TemplateParam === node && node.idltype.is_a?(IDL::Type::Const)) raise "#{node.scoped_name} must be constant: #{node.class.name}." end end @node = node @idltype = node.idltype @value = @idltype.narrow(node.value) unless node.is_template? end |
Instance Attribute Details
#node ⇒ Object (readonly)
Returns the value of attribute node.
38 39 40 |
# File 'lib/ridl/expression.rb', line 38 def node @node end |
Instance Method Details
#instantiate(instantiation_context) ⇒ Object
55 56 57 58 59 60 61 62 |
# File 'lib/ridl/expression.rb', line 55 def instantiate(instantiation_context) if self.is_template? cp = IDL::AST::TemplateParam.concrete_param(instantiation_context, @node) cp.is_a?(Expression) ? cp : ScopedName.new(cp) else self end end |
#is_node?(node_class) ⇒ Boolean
64 65 66 |
# File 'lib/ridl/expression.rb', line 64 def is_node?(node_class) @node.is_a?(node_class) end |
#is_template? ⇒ Boolean
51 52 53 |
# File 'lib/ridl/expression.rb', line 51 def is_template? @node.is_template? end |
#resolved_node ⇒ Object
68 69 70 |
# File 'lib/ridl/expression.rb', line 68 def resolved_node @node end |