Class: Processor
- Inherits:
-
Object
- Object
- Processor
- Defined in:
- lib/Models/Processor.rb
Direct Known Subclasses
AsanaProcessor, FilterProcessor, GoogleAPI, GoogleSheetProcessor, GoogleTranslateProcessor, ProcessorTemplate, SlackAndAsanaConnector, SlackProcessor
Instance Attribute Summary collapse
-
#baseExecutePath ⇒ Object
Returns the value of attribute baseExecutePath.
-
#config ⇒ Object
Returns the value of attribute config.
-
#configFilePath ⇒ Object
Returns the value of attribute configFilePath.
Instance Method Summary collapse
-
#initialize(config, configFilePath, baseExecutePath) ⇒ Processor
constructor
A new instance of Processor.
- #processReviews(reviews, platform) ⇒ Object
- #renderReview(templateText, review, timeZoneOffset) ⇒ Object
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
#baseExecutePath ⇒ Object
Returns the value of attribute baseExecutePath.
5 6 7 |
# File 'lib/Models/Processor.rb', line 5 def baseExecutePath @baseExecutePath end |
#config ⇒ Object
Returns the value of attribute config.
5 6 7 |
# File 'lib/Models/Processor.rb', line 5 def config @config end |
#configFilePath ⇒ Object
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..nil? ? "" :review..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 |