Class: Everlog::Dom::Entity::Aggregate::DailyReport
- Inherits:
-
Everlog::Dom::Entity
- Object
- Everlog::Dom::Entity
- Everlog::Dom::Entity::Aggregate::DailyReport
- Defined in:
- lib/everlog/dom/entity/aggregate/dailyReport.rb
Instance Attribute Summary
Attributes inherited from Everlog::Dom::Entity
Instance Method Summary collapse
- #footer(phrase) ⇒ Object
-
#initialize ⇒ DailyReport
constructor
A new instance of DailyReport.
- #publish(title, access_token, output) ⇒ Object
- #push(service, option) ⇒ Object
Constructor Details
#initialize ⇒ DailyReport
Returns a new instance of DailyReport.
4 5 6 |
# File 'lib/everlog/dom/entity/aggregate/dailyReport.rb', line 4 def initialize @content = Content.new end |
Instance Method Details
#footer(phrase) ⇒ Object
16 17 18 |
# File 'lib/everlog/dom/entity/aggregate/dailyReport.rb', line 16 def phrase @content.push(:footer, Dom::Value::.new(phrase)) end |
#publish(title, access_token, output) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/everlog/dom/entity/aggregate/dailyReport.rb', line 20 def publish(title, access_token, output) return @content.render if output == 'local' Config.evernote.access_secret = access_token Dom::Module::Evernote.publish(title, @content.render, output) ensure Config.clear! end |
#push(service, option) ⇒ Object
8 9 10 11 12 13 14 |
# File 'lib/everlog/dom/entity/aggregate/dailyReport.rb', line 8 def push(service, option) setup_config(service.to_sym, option) data = Dom::Module.const_get(service.capitalize).fetch_since((DateTime.now - 1).to_time) @content.push(service, data) ensure Config.clear! end |