Class: Monotes::SyncList
- Inherits:
-
Object
- Object
- Monotes::SyncList
- Defined in:
- lib/monotes/sync_list.rb
Instance Method Summary collapse
-
#initialize(args) ⇒ SyncList
constructor
A new instance of SyncList.
- #sync ⇒ Object
Constructor Details
#initialize(args) ⇒ SyncList
6 7 8 9 10 |
# File 'lib/monotes/sync_list.rb', line 6 def initialize(args) @list = args.fetch(:list) @adapter = args.fetch(:adapter) @repository = args.fetch(:repo) end |
Instance Method Details
#sync ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/monotes/sync_list.rb', line 12 def sync unsynced = @list.find_all {|issue| issue.unsynced? } unsynced.map do |issue| result = @adapter.create_issue(@repository, issue.title, issue.body) yield(result) if block_given? Monotes::Models::Issue.new(result.to_hash) end end |