Class: ReVIEW::Preprocessor::Repository

Inherits:
Object
  • Object
show all
Includes:
Loggable, TextUtils
Defined in:
lib/review/preprocessor/repository.rb

Instance Attribute Summary

Attributes included from Loggable

#logger

Instance Method Summary collapse

Methods included from Loggable

#app_error, #debug, #error, #error!, #warn

Methods included from TextUtils

#add_space?, #detab, #join_lines_to_paragraph, #split_paragraph

Constructor Details

#initialize(param) ⇒ Repository

Returns a new instance of Repository.



18
19
20
21
22
23
# File 'lib/review/preprocessor/repository.rb', line 18

def initialize(param)
  @repository = {}
  @config = param
  @leave_content = nil
  @logger = ReVIEW.logger
end

Instance Method Details

#fetch(file, type, name) ⇒ Object



33
34
35
36
# File 'lib/review/preprocessor/repository.rb', line 33

def fetch(file, type, name)
  table = file_descripter(file)[type] or return nil
  table[name]
end

#fetch_file(file) ⇒ Object



25
26
27
# File 'lib/review/preprocessor/repository.rb', line 25

def fetch_file(file)
  file_descripter(file)['file']
end

#fetch_range(file, name) ⇒ Object



29
30
31
# File 'lib/review/preprocessor/repository.rb', line 29

def fetch_range(file, name)
  fetch(file, 'range', name)
end