Class: Everlog::Dom::Entity::Aggregate::DailyReport

Inherits:
Everlog::Dom::Entity show all
Defined in:
lib/everlog/dom/entity/aggregate/dailyReport.rb

Instance Attribute Summary

Attributes inherited from Everlog::Dom::Entity

#id

Instance Method Summary collapse

Constructor Details

#initializeDailyReport

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



16
17
18
# File 'lib/everlog/dom/entity/aggregate/dailyReport.rb', line 16

def footer phrase
  @content.push(:footer, Dom::Value::Footer.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