Sha256: 121355ac179562572d9c86c8d1ef85a379cf0dd5322a2fe8d1ec03ae1e66419b
Contents?: true
Size: 670 Bytes
Versions: 6
Compression:
Stored size: 670 Bytes
Contents
# frozen_string_literal: true require "sod" module Milestoner module CLI module Actions module Cache # Handles finding a user in the cache. class Find < Sod::Action include Import[:kernel, :logger, client: :cache] description "Find user." on %w[-f --find], argument: "NAME" def call name client.commit(:users) { find name } .either(method(:success), method(:failure)) end private def success(user) = kernel.puts user.to_h.values.join(", ") def failure(message) = logger.abort message end end end end end
Version data entries
6 entries across 6 versions & 1 rubygems