Class: RBS::Prototype::Runtime::StructGenerator

Inherits:
ValueObjectBase show all
Defined in:
lib/rbs/prototype/runtime/value_object_generator.rb

Class Method Summary collapse

Methods inherited from ValueObjectBase

#build_decl, #initialize

Constructor Details

This class inherits a constructor from RBS::Prototype::Runtime::ValueObjectBase

Class Method Details

.generatable?(target) ⇒ Boolean

Returns:

  • (Boolean)


90
91
92
93
94
95
96
# File 'lib/rbs/prototype/runtime/value_object_generator.rb', line 90

def self.generatable?(target)
  return false unless target < Struct
  # Avoid direct inherited class like `class Option < Struct`
  return false unless target.respond_to?(:members)

  true
end