Class: RemoteRecord::Transformers::Base
- Inherits:
-
Object
- Object
- RemoteRecord::Transformers::Base
- Defined in:
- lib/remote_record/transformers/base.rb
Overview
Base transformer class. Inherit from this and implement ‘#transform`.
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(data, direction = :up) ⇒ Base
constructor
A new instance of Base.
- #transform ⇒ Object
Constructor Details
#initialize(data, direction = :up) ⇒ Base
Returns a new instance of Base.
7 8 9 10 11 12 |
# File 'lib/remote_record/transformers/base.rb', line 7 def initialize(data, direction = :up) raise ArgumentError, 'The direction should be one of :up or :down.' unless %i[up down].include? direction @data = data @direction = direction end |
Instance Method Details
#transform ⇒ Object
14 15 16 |
# File 'lib/remote_record/transformers/base.rb', line 14 def transform raise NotImplementedError end |