Class: RbsSettingslogic::Settingslogic::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/rbs_settingslogic/settingslogic.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(klass) ⇒ Generator

Returns a new instance of Generator.



15
16
17
# File 'lib/rbs_settingslogic/settingslogic.rb', line 15

def initialize(klass)
  @klass = klass
end

Instance Attribute Details

#klassObject (readonly)

Returns the value of attribute klass.



13
14
15
# File 'lib/rbs_settingslogic/settingslogic.rb', line 13

def klass
  @klass
end

Instance Method Details

#generateObject



19
20
21
22
23
24
25
26
# File 'lib/rbs_settingslogic/settingslogic.rb', line 19

def generate
  format <<~RBS
    class #{klass.name} < ::Settingslogic
      #{generate_classes(klass)}
      #{generate_methods(klass)}
    end
  RBS
end