Class: Bluplate::Inbox
- Inherits:
-
Object
- Object
- Bluplate::Inbox
- Includes:
- Persist::Base
- Defined in:
- lib/bluplate/inbox.rb
Instance Attribute Summary collapse
-
#sources ⇒ Object
Returns the value of attribute sources.
-
#tasks ⇒ Object
Returns the value of attribute tasks.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Inbox
constructor
A new instance of Inbox.
- #retrieve ⇒ Object
- #to_hash ⇒ Object
Methods included from Persist::Base
Constructor Details
#initialize(opts = {}) ⇒ Inbox
Returns a new instance of Inbox.
7 8 9 10 |
# File 'lib/bluplate/inbox.rb', line 7 def initialize(opts={}) @tasks = {} @sources = opts[:sources] end |
Instance Attribute Details
#sources ⇒ Object
Returns the value of attribute sources.
5 6 7 |
# File 'lib/bluplate/inbox.rb', line 5 def sources @sources end |
#tasks ⇒ Object
Returns the value of attribute tasks.
5 6 7 |
# File 'lib/bluplate/inbox.rb', line 5 def tasks @tasks end |
Instance Method Details
#retrieve ⇒ Object
16 17 18 19 20 |
# File 'lib/bluplate/inbox.rb', line 16 def retrieve if @sources && !@sources.empty? @sources.inject(@tasks){|e, i| e + i.import} end end |
#to_hash ⇒ Object
12 13 14 |
# File 'lib/bluplate/inbox.rb', line 12 def to_hash {:tasks => @tasks } end |