Sha256: f0c9ddc64bb68b71634eae3e4417cc7230ae93257e49517112c1573a86933fc2

Contents?: true

Size: 546 Bytes

Versions: 4

Compression:

Stored size: 546 Bytes

Contents

module ActiveGit
  class FileEvent

    def initialize(data, working_path=nil)
      @data = data
      @working_path = working_path || ActiveGit.configuration.working_path
    end

    def synchronize(synchronizer)
      raise 'Must implement in subclass'
    end

    protected

    def model
      @data.class
    end

    def model_path
      Inflector.dirname(model, @working_path)
    end

    def file_name
      Inflector.filename(@data, @working_path)
    end

    def json
      JSON.pretty_generate(@data.attributes)
    end

  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
active_git-0.0.7 lib/active_git/events/file_event.rb
active_git-0.0.6 lib/active_git/events/file_event.rb
active_git-0.0.5 lib/active_git/events/file_event.rb
active_git-0.0.4 lib/active_git/events/file_event.rb