Class: ROM::ClassBuilder
- Inherits:
-
Object
- Object
- ROM::ClassBuilder
- Includes:
- Options
- Defined in:
- lib/rom/support/class_builder.rb
Overview
Internal support class for generating classes
Constant Summary
Constants included from Options
Options::InvalidOptionKeyError, Options::InvalidOptionValueError
Instance Attribute Summary
Attributes included from Options
Instance Method Summary collapse
-
#call {|klass| ... } ⇒ Class
private
Generate a class based on options.
Methods included from Options
Instance Method Details
#call {|klass| ... } ⇒ Class
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Generate a class based on options
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/rom/support/class_builder.rb', line 24 def call klass = Class.new(parent) klass.class_eval <<-RUBY, __FILE__, __LINE__ + 1 def self.name #{name.inspect} end def self.inspect name end def self.to_str name end def self.to_s name end RUBY yield(klass) if block_given? klass end |