Class: Git::Status::StatusFileFactory Private

Inherits:
Object
  • Object
show all
Defined in:
lib/git/status.rb

Overview

This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.

A factory class responsible for fetching git status data and building a hash of StatusFile objects.

Instance Method Summary collapse

Constructor Details

#initialize(base) ⇒ StatusFileFactory

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Create a new factory backed by the given git object

Parameters:

  • base (Git::Repository)

    the git object used as the status data provider



286
287
288
# File 'lib/git/status.rb', line 286

def initialize(base)
  @base = base
end

Instance Method Details

#construct_filesHash{String => Git::Status::StatusFile}

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.

Gather all status data and build a hash of file paths to StatusFile objects

Returns:



295
296
297
298
299
300
# File 'lib/git/status.rb', line 295

def construct_files
  files_data = fetch_all_files_data
  files_data.transform_values do |data|
    StatusFile.new(@base, data)
  end
end