Class: Cygnet::MappedCollection
- Inherits:
-
Array
- Object
- Array
- Cygnet::MappedCollection
- Defined in:
- lib/cygnet/collections.rb
Overview
Builds flattened collections of objects for easy return
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(builder, records) ⇒ MappedCollection
constructor
rubocop:disable Lint/MissingSuper.
Constructor Details
#initialize(builder, records) ⇒ MappedCollection
rubocop:disable Lint/MissingSuper
6 7 8 9 10 11 |
# File 'lib/cygnet/collections.rb', line 6 def initialize(builder, records) # rubocop:disable Lint/MissingSuper @builder = builder @records = records self << records.map(&builder.method(:new)) flatten! end |