class Monotes::SyncList

Public Class Methods

new(args) click to toggle source
# File lib/monotes/sync_list.rb, line 6
def initialize(args)
  @list = args.fetch(:list)
  @adapter = args.fetch(:adapter)
  @repository = args.fetch(:repo)
end

Public Instance Methods

sync() { |result| ... } click to toggle source
# 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