Class: Generators::Avo::Inspector

Inherits:
Object
  • Object
show all
Defined in:
lib/generators/avo/resource_generator.rb

Overview

This class modifies the inspect function to correctly handle polymorphic associations. It is used in the polymorphic_association_types function. Without modification: Model(id: integer, name: string) After modification: Model

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Inspector

Returns a new instance of Inspector.



326
327
328
# File 'lib/generators/avo/resource_generator.rb', line 326

def initialize(name)
  @name = name
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



325
326
327
# File 'lib/generators/avo/resource_generator.rb', line 325

def name
  @name
end

Instance Method Details

#inspectObject



330
331
332
# File 'lib/generators/avo/resource_generator.rb', line 330

def inspect
  name
end