Class: Parlour::RbsGenerator::ModuleNamespace
- Inherits:
-
Namespace
- Object
- TypedObject
- RbsObject
- Namespace
- Parlour::RbsGenerator::ModuleNamespace
- Extended by:
- T::Sig
- Defined in:
- lib/parlour/rbs_generator/module_namespace.rb
Overview
Represents a module definition.
Constant Summary collapse
- Child =
type_member {{ fixed: RbsObject }}
Instance Attribute Summary
Attributes inherited from Namespace
Attributes inherited from RbsObject
Attributes inherited from TypedObject
#comments, #generated_by, #name
Instance Method Summary collapse
- #describe_attrs ⇒ Object
-
#generate_rbs(indent_level, options) ⇒ Array<String>
Generates the RBS lines for this module.
Methods inherited from Namespace
#add_comment_to_next_child, #aliases, #constants, #create_arbitrary, #create_attr_accessor, #create_attr_reader, #create_attr_writer, #create_attribute, #create_class, #create_constant, #create_extend, #create_extends, #create_include, #create_includes, #create_interface, #create_method, #create_module, #create_type_alias, #extends, #includes, #initialize, #merge_into_self, #mergeable?, #path
Methods included from Mixin::Searchable
Methods inherited from RbsObject
#initialize, #merge_into_self, #mergeable?
Methods inherited from TypedObject
#add_comment, #describe, #describe_tree, #initialize
Constructor Details
This class inherits a constructor from Parlour::RbsGenerator::Namespace
Instance Method Details
#describe_attrs ⇒ Object
29 30 31 |
# File 'lib/parlour/rbs_generator/module_namespace.rb', line 29 def describe_attrs [:children] end |
#generate_rbs(indent_level, options) ⇒ Array<String>
Generates the RBS lines for this module.
21 22 23 24 25 26 |
# File 'lib/parlour/rbs_generator/module_namespace.rb', line 21 def generate_rbs(indent_level, ) lines = generate_comments(indent_level, ) lines << .indented(indent_level, "module #{name}") lines += generate_body(indent_level + 1, ) lines << .indented(indent_level, "end") end |