Class: Ace::Support::Models::CLI::Commands::Cache::Sync
- Inherits:
-
Cli::Command
- Object
- Cli::Command
- Ace::Support::Models::CLI::Commands::Cache::Sync
- Includes:
- Cli::Base
- Defined in:
- lib/ace/support/models/cli/commands/cache/sync.rb
Overview
Fetch models from models.dev API
Instance Method Summary collapse
Instance Method Details
#call(**options) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/ace/support/models/cli/commands/cache/sync.rb', line 26 def call(**) result = Organisms::SyncOrchestrator.new.sync(force: [:force]) if [:json] puts JSON.pretty_generate(result) return end case result[:status] when :success puts result[:message] puts "Duration: #{result[:duration]}s" when :skipped puts result[:message] puts "Last synced: #{result[:last_sync_at]}" when :error raise Ace::Support::Cli::Error.new(result[:message]) end end |