Sha256: 799a92859962ce46cbc153c1ba7f205d1013331d36a4bbb0853d159b7e6adb09

Contents?: true

Size: 597 Bytes

Versions: 1

Compression:

Stored size: 597 Bytes

Contents

module Memento::Action
  
  class Base
    def initialize(state)
      @state = state
    end
    
    def record
      @state.record
    end
    
    def record_data
      @state.record_data
    end
    
    def fetch?
      true
    end
    
    def self.inherited(child)
      action_type = child.name.demodulize.underscore
      write_inheritable_attribute(:action_types, action_types << action_type)
    end
    
    def self.action_types
      read_inheritable_attribute(:action_types) || []
    end
  end
  
end

Dir["#{File.dirname(__FILE__)}/action/*.rb"].each { |action| require action }

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
yolk-memento-0.2.0 lib/memento/action.rb