Class: Stockboy::MappedRecord
- Inherits:
-
Object
- Object
- Stockboy::MappedRecord
- Defined in:
- lib/stockboy/mapped_record.rb
Overview
This represents the “output” side of a CandidateRecord
Based on the current attribute map, it will have reader methods for the output values of each attribute. This is similar to an OpenStruct, but more efficient since we cache the defined methods.
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(fields) ⇒ MappedRecord
constructor
Initialize a new MappedRecord.
Constructor Details
#initialize(fields) ⇒ MappedRecord
Initialize a new MappedRecord
45 46 47 48 49 50 |
# File 'lib/stockboy/mapped_record.rb', line 45 def initialize(fields) mod = AccessorMethods.for(fields.keys) extend mod @fields = fields freeze end |