Sha256: 6d7656a1a1efd6c58928dddb22739b98ce6b33703522603da8f96390679185b8

Contents?: true

Size: 674 Bytes

Versions: 1

Compression:

Stored size: 674 Bytes

Contents

module Shapeshifter
  class Shifter
    attr_reader :source_object

    def initialize(source_object)
      @source_object = source_object
    end

    class << self
      def chain(shifter)
        ShiftChain.new(self).chain(shifter)
      end

      def shift(source_object, target_object)
        ShiftChain.new(self).shift(source_object, target_object)
      end

      def revert(source_object, target_object)
        ShiftChain.new(self).revert(source_object, target_object)
      end
    end
    
    def shift(_)
      raise NoMethodError.new('Should be overridden')
    end

    def revert(_)
      raise NoMethodError.new('Should be overridden')
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
shapeshifter-0.0.1 lib/shapeshifter/shifter.rb