Class: ROM::Factory::Structs
- Inherits:
-
Object
- Object
- ROM::Factory::Structs
- Defined in:
- lib/rom/factory/factories.rb
Overview
In-memory builder API
Instance Attribute Summary collapse
- #registry ⇒ Object readonly
- #struct_namespace ⇒ Object readonly
Instance Method Summary collapse
-
#[](name, *traits, **attrs) ⇒ ROM::Struct
Build an in-memory struct.
Instance Attribute Details
#registry ⇒ Object (readonly)
18 19 20 |
# File 'lib/rom/factory/factories.rb', line 18 def registry @registry end |
#struct_namespace ⇒ Object (readonly)
22 23 24 |
# File 'lib/rom/factory/factories.rb', line 22 def struct_namespace @struct_namespace end |
Instance Method Details
#[](name, *traits, **attrs) ⇒ ROM::Struct
Build an in-memory struct
44 45 46 |
# File 'lib/rom/factory/factories.rb', line 44 def [](name, *traits, **attrs) registry[name].struct_namespace(struct_namespace).create(*traits, attrs) end |