class RemoteRecord::Transformers::Base

Base transformer class. Inherit from this and implement `#transform`.

Public Class Methods

new(data, direction = :up) click to toggle source
# 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

Public Instance Methods

transform() click to toggle source
# File lib/remote_record/transformers/base.rb, line 14
def transform
  raise NotImplementedError
end