Class: ReviewFetcher
- Inherits:
-
Object
show all
- Defined in:
- lib/Models/ReviewFetcher.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
11
12
13
|
# File 'lib/Models/ReviewFetcher.rb', line 11
def config
@config
end
|
#logger ⇒ Object
Returns the value of attribute logger.
11
12
13
|
# File 'lib/Models/ReviewFetcher.rb', line 11
def logger
@logger
end
|
Returns the value of attribute platform.
11
12
13
|
# File 'lib/Models/ReviewFetcher.rb', line 11
def platform
@platform
end
|
#processors ⇒ Object
Returns the value of attribute processors.
11
12
13
|
# File 'lib/Models/ReviewFetcher.rb', line 11
def processors
@processors
end
|
Instance Method Details
#execute ⇒ Object
13
14
15
|
# File 'lib/Models/ReviewFetcher.rb', line 13
def execute()
end
|
40
41
42
43
44
45
46
47
|
# File 'lib/Models/ReviewFetcher.rb', line 40
def getPlatformLatestCheckTimestamp()
filePath = "#{config.baseExecutePath}/latestCheckTimestamp/#{platform}"
if File.exists?(filePath)
return File.read(filePath).to_i
else
return 0
end
end
|
#processReviews(reviews, platform) ⇒ Object
21
22
23
24
25
|
# File 'lib/Models/ReviewFetcher.rb', line 21
def processReviews(reviews, platform)
processors.each do |processor|
reviews = processor.processReviews(reviews, platform)
end
end
|
#registerProcessor(processor) ⇒ Object
17
18
19
|
# File 'lib/Models/ReviewFetcher.rb', line 17
def registerProcessor(processor)
processors.append(processor)
end
|
#sendWelcomMessage ⇒ Object
27
28
29
30
31
32
|
# File 'lib/Models/ReviewFetcher.rb', line 27
def sendWelcomMessage()
slackProcessor = processors.find { |processor| processor.is_a?(SlackProcessor) }
if !slackProcessor.nil?
slackProcessor.sendWelcomMessage(platform)
end
end
|
34
35
36
37
38
|
# File 'lib/Models/ReviewFetcher.rb', line 34
def setPlatformLatestCheckTimestamp(timestamp)
basePath = "#{config.baseExecutePath}/latestCheckTimestamp/"
Helper.createDirIfNotExist(basePath)
File.open("#{basePath}/#{platform}", 'w') { |file| file.write(timestamp) }
end
|