Class: SimpleRewriter::Reader
- Inherits:
-
Object
- Object
- SimpleRewriter::Reader
- Defined in:
- lib/simple_rewriter/reader.rb
Constant Summary collapse
- INDEX_OF_ATTRIBUTE_NAME =
0
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(record, attributes) ⇒ Reader
constructor
A new instance of Reader.
Constructor Details
#initialize(record, attributes) ⇒ Reader
Returns a new instance of Reader.
8 9 10 11 |
# File 'lib/simple_rewriter/reader.rb', line 8 def initialize(record, attributes) @record = record @attributes = attributes end |
Class Method Details
.call(record, attributes) ⇒ Object
4 5 6 |
# File 'lib/simple_rewriter/reader.rb', line 4 def self.call(record, attributes) new(record, attributes).call { |data| yield(data) } end |
Instance Method Details
#call ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/simple_rewriter/reader.rb', line 13 def call attributes.each do || = yield [attribute, attr_value, ] end end |