Class: IcAgent::Ast::Nodes::NamedNode
- Inherits:
-
Treetop::Runtime::SyntaxNode
- Object
- Treetop::Runtime::SyntaxNode
- IcAgent::Ast::Nodes::NamedNode
show all
- Defined in:
- lib/ic_agent/ast/nodes/named_nodes.rb
Direct Known Subclasses
BaseType, BaseTypeChild, BaseTypeContent, BaseTypeFunc, BaseTypeKey, BaseTypeOpt, BaseTypeOther, BaseTypeRecord, BaseTypeSingle, BaseTypeVariant, BaseTypeVec, Comment, DIDFile, IcServiceItem, IcServiceMethodName, IcServiceMethodParams, IcServiceMethodQuery, IcServiceMethodReturn, IcServiceMethods, IcServiceName, IcServiceParam, Instruction, Service, TypeDeclaration, TypeName
Instance Method Summary
collapse
Instance Method Details
#elements_to_s ⇒ Object
19
20
21
|
# File 'lib/ic_agent/ast/nodes/named_nodes.rb', line 19
def elements_to_s
elements.map(&:to_s).join("\n")
end
|
#source_content ⇒ Object
23
24
25
|
# File 'lib/ic_agent/ast/nodes/named_nodes.rb', line 23
def source_content
self.text_value.strip
end
|
#title ⇒ Object
7
8
9
|
# File 'lib/ic_agent/ast/nodes/named_nodes.rb', line 7
def title
:named_node
end
|
#to_array ⇒ Object
11
12
13
|
# File 'lib/ic_agent/ast/nodes/named_nodes.rb', line 11
def to_array
[title] + elements.map(&:to_array)
end
|
#to_s ⇒ Object
15
16
17
|
# File 'lib/ic_agent/ast/nodes/named_nodes.rb', line 15
def to_s
"#{title.to_s.upcase} #{elements_to_s}"
end
|