Class: RBS::Prototype::Runtime::ValueObjectBase

Inherits:
Object
  • Object
show all
Includes:
Helpers
Defined in:
lib/rbs/prototype/runtime/value_object_generator.rb

Direct Known Subclasses

DataGenerator, StructGenerator

Instance Method Summary collapse

Constructor Details

#initialize(target_class) ⇒ ValueObjectBase

Returns a new instance of ValueObjectBase.



11
12
13
# File 'lib/rbs/prototype/runtime/value_object_generator.rb', line 11

def initialize(target_class)
  @target_class = target_class
end

Instance Method Details

#build_declObject



15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/rbs/prototype/runtime/value_object_generator.rb', line 15

def build_decl
  decl = AST::Declarations::Class.new(
    name: to_type_name(only_name(@target_class)),
    type_params: [],
    super_class: build_super_class,
    members: [],
    annotations: [],
    location: nil,
    comment: nil
  )

  add_decl_members(decl)

  decl
end