Class: RBS::Dynamic::Builder::Class
- Inherits:
-
Base
- Object
- Base
- RBS::Dynamic::Builder::Class
- Defined in:
- lib/rbs/dynamic/builder.rb
Instance Attribute Summary collapse
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
Instance Method Summary collapse
- #build ⇒ Object
- #build_super_class ⇒ Object
-
#initialize(klass) ⇒ Class
constructor
A new instance of Class.
Constructor Details
#initialize(klass) ⇒ Class
Returns a new instance of Class.
165 166 167 168 |
# File 'lib/rbs/dynamic/builder.rb', line 165 def initialize(klass) super() @klass = klass end |
Instance Attribute Details
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
163 164 165 |
# File 'lib/rbs/dynamic/builder.rb', line 163 def klass @klass end |
Instance Method Details
#build ⇒ Object
170 171 172 173 174 175 176 177 178 179 180 |
# File 'lib/rbs/dynamic/builder.rb', line 170 def build RBS::AST::Declarations::Class.new( name: klass.name, type_params: [], super_class: build_super_class, members: build_members, location: nil, annotations: [], comment: nil ) end |
#build_super_class ⇒ Object
182 183 184 185 186 187 188 |
# File 'lib/rbs/dynamic/builder.rb', line 182 def build_super_class ::RBS::AST::Declarations::Class::Super.new( name: klass.superclass.name, args: [], location: nil ) unless klass.superclass&.name.nil? || Object == klass.superclass end |