Class: Stockboy::SourceRecord
- Inherits:
-
MappedRecord
- Object
- MappedRecord
- Stockboy::SourceRecord
- Defined in:
- lib/stockboy/source_record.rb
Overview
This represents the raw “input” side of a CandidateRecord
It provides access to the original field values before mapping or translation as hash keys.
Instance Method Summary collapse
-
#[](key) ⇒ Object
Access a raw field value by the original input field name.
-
#initialize(mapped_fields, data_fields) ⇒ SourceRecord
constructor
Initialize a new instance.
Constructor Details
#initialize(mapped_fields, data_fields) ⇒ SourceRecord
Initialize a new instance
27 28 29 30 |
# File 'lib/stockboy/source_record.rb', line 27 def initialize(mapped_fields, data_fields) @data_fields = data_fields super(mapped_fields) end |
Instance Method Details
#[](key) ⇒ Object
Access a raw field value by the original input field name
36 37 38 39 |
# File 'lib/stockboy/source_record.rb', line 36 def [](key) key = key.to_s if key.is_a? Symbol @data_fields[key] end |