Sha256: 301f2ca8a5a6282f9f185c9c14718f226a509cbea317bfa9b4c170c25aabeff8

Contents?: true

Size: 1.21 KB

Versions: 22

Compression:

Stored size: 1.21 KB

Contents

$lib = File.expand_path('../lib', File.dirname(__FILE__))


require "Processors/SlackProcessor"
require "Models/Processor"
require "time"

class ReviewFetcher

    attr_accessor :config, :platform, :processors, :logger

    def execute()

    end

    def registerProcessor(processor)
        processors.append(processor)
    end

    def processReviews(reviews, platform)
        processors.each do |processor|
            reviews = processor.processReviews(reviews, platform)
        end
    end

    def sendWelcomMessage()
        slackProcessor = processors.find { |processor| processor.is_a?(SlackProcessor) }
        if !slackProcessor.nil?
            slackProcessor.sendWelcomMessage(platform)
        end
    end

    def setPlatformLatestCheckTimestamp(timestamp)
        basePath = "#{config.baseExecutePath}/latestCheckTimestamp/"
        Helper.createDirIfNotExist(basePath)
        File.open("#{basePath}/#{platform}", 'w') { |file| file.write(timestamp) }
    end

    def getPlatformLatestCheckTimestamp()
        filePath = "#{config.baseExecutePath}/latestCheckTimestamp/#{platform}"
        if File.exists?(filePath)
            return File.read(filePath).to_i
        else
            return 0
        end
    end
end

Version data entries

22 entries across 22 versions & 1 rubygems

Version Path
ZReviewTender-1.3.4 lib/Models/ReviewFetcher.rb
ZReviewTender-1.3.3 lib/Models/ReviewFetcher.rb
ZReviewTender-1.3.2 lib/Models/ReviewFetcher.rb
ZReviewTender-1.3.1 lib/Models/ReviewFetcher.rb
ZReviewTender-1.3.0 lib/Models/ReviewFetcher.rb
ZReviewTender-1.2.8 lib/Models/ReviewFetcher.rb
ZReviewTender-1.2.7 lib/Models/ReviewFetcher.rb
ZReviewTender-1.2.6 lib/Models/ReviewFetcher.rb
ZReviewTender-1.2.5 lib/Models/ReviewFetcher.rb
ZReviewTender-1.2.4 lib/Models/ReviewFetcher.rb
ZReviewTender-1.2.3 lib/Models/ReviewFetcher.rb
ZReviewTender-1.2.2 lib/Models/ReviewFetcher.rb
ZReviewTender-1.2.1 lib/Models/ReviewFetcher.rb
ZReviewTender-1.2.0 lib/Models/ReviewFetcher.rb
ZReviewTender-1.1.1 lib/Models/ReviewFetcher.rb
ZReviewTender-1.1.0 lib/Models/ReviewFetcher.rb
ZReviewTender-1.0.8 lib/Models/ReviewFetcher.rb
ZReviewTender-1.0.7 lib/Models/ReviewFetcher.rb
ZReviewTender-1.0.6 lib/Models/ReviewFetcher.rb
ZReviewTender-1.0.5 lib/Models/ReviewFetcher.rb