Class: ForemanGitTemplates::RepositoryReader
- Inherits:
-
Object
- Object
- ForemanGitTemplates::RepositoryReader
- Defined in:
- app/services/foreman_git_templates/repository_reader.rb
Defined Under Namespace
Classes: EmptyFileError, FileUnreadableError, MissingFileError, RepositoryReaderError, RepositoryUnreadableError
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(repository_path, file) ⇒ RepositoryReader
constructor
A new instance of RepositoryReader.
Constructor Details
#initialize(repository_path, file) ⇒ RepositoryReader
Returns a new instance of RepositoryReader.
5 6 7 8 |
# File 'app/services/foreman_git_templates/repository_reader.rb', line 5 def initialize(repository_path, file) @repository_path = repository_path @file = file end |
Class Method Details
.call(repository_path, file) ⇒ Object
15 16 17 |
# File 'app/services/foreman_git_templates/repository_reader.rb', line 15 def self.call(repository_path, file) new(repository_path, file).call end |
Instance Method Details
#call ⇒ Object
10 11 12 13 |
# File 'app/services/foreman_git_templates/repository_reader.rb', line 10 def call raise MissingFileError, "The #{file} file is missing" if content.nil? content end |