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 " def self.name\n \#{name.inspect}\n end\n\n def self.inspect\n name\n end\n\n def self.to_str\n name\n end\n\n def self.to_s\n name\n end\n RUBY\n\n yield(klass) if block_given?\n\n klass\nend\n", __FILE__, __LINE__ + 1 |