Sha256: 57097f2c9188c6cb56b5c8279f51cc7f9290a84ebbd70b105a1be2c978d533d5
Contents?: true
Size: 1.05 KB
Versions: 2
Compression:
Stored size: 1.05 KB
Contents
module Troo module Commands class RefreshAll # @return [String] def self.dispatch new.refresh_all end # @return [String] def refresh_all return success if refreshed? failure end private def success 'All local data refreshed.' end def failure 'Cannot refresh all local data.' end def refreshed? return false if resources.none? Troo::Refresh.completed! true end def resources @resources ||= external_ids.inject([]) do |acc, id| acc << Retrieval::Remote.fetch(Remote::Board, id, mode: :board) acc << Retrieval::Remote.fetch(Remote::Comment, id, mode: :board) acc end end def external_ids all_boards.map(&:id) end def all_boards @boards ||= Retrieval::Remote .fetch(Remote::Board, nil, options) end def options { mode: :all, persist: false } end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
troo-0.0.15 | lib/troo/cli/commands/refresh/all.rb |
troo-0.0.14 | lib/troo/cli/commands/refresh/all.rb |