Class: Yadriggy::SingularClassDef
- Defined in:
- lib/yadriggy/ast.rb
Overview
Singular class definition.
Instance Attribute Summary
Attributes inherited from ModuleDef
Attributes inherited from ASTnode
Class Method Summary collapse
Instance Method Summary collapse
-
#accept(evaluator) ⇒ void
A method for Visitor pattern.
-
#initialize(sexp) ⇒ SingularClassDef
constructor
A new instance of SingularClassDef.
-
#name ⇒ Keyword|VariableCall|ASTnode
Self, the object, ...
Methods inherited from ModuleDef
Methods included from AstHelper
#has_tag?, #to_node, #to_nodes
Methods inherited from ASTnode
#add_child, #add_children, #const_value, #const_value_in_class, #get_context_class, #get_receiver_object, #is_proc?, #pretty_print, #root, #source_location, #source_location_string, #value, #value_in_class
Constructor Details
#initialize(sexp) ⇒ SingularClassDef
Returns a new instance of SingularClassDef.
1692 1693 1694 1695 1696 |
# File 'lib/yadriggy/ast.rb', line 1692 def initialize(sexp) @name = to_node(sexp[1]) # Keyword, VariableCall, ... add_child(@name) initialize_body(has_tag?(sexp[2], :bodystmt)) end |
Class Method Details
.tag ⇒ Object
1690 |
# File 'lib/yadriggy/ast.rb', line 1690 def self.tag() :sclass end |
Instance Method Details
#accept(evaluator) ⇒ void
This method returns an undefined value.
A method for Visitor pattern.
1704 1705 1706 |
# File 'lib/yadriggy/ast.rb', line 1704 def accept(evaluator) evaluator.singular_class_def(self) end |
#name ⇒ Keyword|VariableCall|ASTnode
Returns self, the object, ...
1699 |
# File 'lib/yadriggy/ast.rb', line 1699 def name() super end |