Class: Tensai::Util::Initializer::InitializeMethod

Inherits:
Object
  • Object
show all
Defined in:
lib/tensai/util/initializer.rb

Overview

Generates initialize method code

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ InitializeMethod

Returns a new instance of InitializeMethod.



51
52
53
# File 'lib/tensai/util/initializer.rb', line 51

def initialize(args)
  @args = args
end

Instance Method Details

#codeObject



55
56
57
58
59
60
61
62
63
# File 'lib/tensai/util/initializer.rb', line 55

def code
  <<~CODE
    def initialize(#{signature})
      #{assign_instance_variables_code}
      #{check_argument_types_code}
      after_initialize
    end
  CODE
end