Class: Parlour::RbsGenerator
- Defined in:
- lib/parlour/rbs_generator.rb,
lib/parlour/rbs_generator/block.rb,
lib/parlour/rbs_generator/extend.rb,
lib/parlour/rbs_generator/method.rb,
lib/parlour/rbs_generator/include.rb,
lib/parlour/rbs_generator/constant.rb,
lib/parlour/rbs_generator/arbitrary.rb,
lib/parlour/rbs_generator/attribute.rb,
lib/parlour/rbs_generator/namespace.rb,
lib/parlour/rbs_generator/parameter.rb,
lib/parlour/rbs_generator/rbs_object.rb,
lib/parlour/rbs_generator/type_alias.rb,
lib/parlour/rbs_generator/class_namespace.rb,
lib/parlour/rbs_generator/method_signature.rb,
lib/parlour/rbs_generator/module_namespace.rb,
lib/parlour/rbs_generator/interface_namespace.rb
Overview
The RBS generator.
Direct Known Subclasses
Defined Under Namespace
Classes: Arbitrary, Attribute, Block, ClassNamespace, Constant, Extend, Include, InterfaceNamespace, Method, MethodSignature, ModuleNamespace, Namespace, Parameter, RbsObject, TypeAlias
Instance Attribute Summary collapse
-
#root ⇒ Namespace
readonly
The root Namespace of this generator.
Attributes inherited from Generator
Instance Method Summary collapse
-
#initialize(**hash) ⇒ RbsGenerator
constructor
A new instance of RbsGenerator.
-
#rbs ⇒ String
Returns the complete contents of the generated RBS file as a string.
Constructor Details
#initialize(**hash) ⇒ RbsGenerator
Returns a new instance of RbsGenerator.
5 6 7 8 |
# File 'lib/parlour/rbs_generator.rb', line 5 def initialize(**hash) super @root = RbsGenerator::Namespace.new(self) end |
Instance Attribute Details
Instance Method Details
#rbs ⇒ String
Returns the complete contents of the generated RBS file as a string.
19 20 21 |
# File 'lib/parlour/rbs_generator.rb', line 19 def rbs root.generate_rbs(0, ).join("\n") end |