class Parlour::RbsGenerator::ModuleNamespace
Represents a module definition.
Public Instance Methods
describe()
click to toggle source
Returns a human-readable brief string description of this module. @return [String]
# File lib/parlour/rbs_generator/module_namespace.rb, line 29 def describe "Module #{name} - #{children.length} " + "children, #{includes.length} includes, #{extends.length} extends" end
generate_rbs(indent_level, options)
click to toggle source
Generates the RBS lines for this module.
@param indent_level [Integer] The indentation level to generate the lines at. @param options [Options] The formatting options to use. @return [Array<String>] The RBS lines, formatted as specified.
# File lib/parlour/rbs_generator/module_namespace.rb, line 19 def generate_rbs(indent_level, options) lines = generate_comments(indent_level, options) lines << options.indented(indent_level, "module #{name}") lines += generate_body(indent_level + 1, options) lines << options.indented(indent_level, "end") end