Class: Processor

Inherits:
Object
  • Object
show all
Defined in:
lib/Models/Processor.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config, configFilePath, baseExecutePath) ⇒ Processor

Returns a new instance of Processor.



7
8
9
10
11
# File 'lib/Models/Processor.rb', line 7

def initialize(config, configFilePath, baseExecutePath)
    @config = config
    @configFilePath = configFilePath
    @baseExecutePath = baseExecutePath
end

Instance Attribute Details

#baseExecutePathObject

Returns the value of attribute baseExecutePath.



5
6
7
# File 'lib/Models/Processor.rb', line 5

def baseExecutePath
  @baseExecutePath
end

#configObject

Returns the value of attribute config.



5
6
7
# File 'lib/Models/Processor.rb', line 5

def config
  @config
end

#configFilePathObject

Returns the value of attribute configFilePath.



5
6
7
# File 'lib/Models/Processor.rb', line 5

def configFilePath
  @configFilePath
end

Instance Method Details

#processReviews(reviews, platform) ⇒ Object



13
14
15
# File 'lib/Models/Processor.rb', line 13

def processReviews(reviews, platform)

end

#renderReview(templateText, review, timeZoneOffset) ⇒ Object



17
18
19
20
21
22
23
24
25
26
27
28
29
30
# File 'lib/Models/Processor.rb', line 17

def renderReview(templateText, review, timeZoneOffset)
    templateText = templateText.gsub("%TITLE%", review.title || "")
    templateText = templateText.gsub("%BODY%", review.body || "")
    templateText = templateText.gsub("%RATING%", review.rating.nil? ? "" :review.rating.to_s)
    templateText = templateText.gsub("%PLATFORM%", review.platform || "")
    templateText = templateText.gsub("%ID%", review.id || "")
    templateText = templateText.gsub("%USERNAME%", review.userName || "")
    templateText = templateText.gsub("%URL%", review.url || "")
    templateText = templateText.gsub("%TERRITORY%", review.territory || "")
    templateText = templateText.gsub("%APPVERSION%", review.appVersion || "")
    templateText = templateText.gsub("%CREATEDDATE%", review.createdDateTimestamp.nil? ? "" : Time.at(review.createdDateTimestamp).getlocal(timeZoneOffset).to_s)

    return templateText
end