Sha256: 9f5fc000c277521b4bc3ebb170ce2b1e233e0e6726926d9e25b2ca4570fb2ddc
Contents?: true
Size: 1.01 KB
Versions: 1
Compression:
Stored size: 1.01 KB
Contents
require 'thor' require 'search_kit/thor' module SearchKit module CLI class Subscribers < Thor namespace :subscribers no_commands do def client @client ||= SearchKit::Clients::Subscribers.new end def messages @messages ||= Messages.new end end document :create def create(email, password) subscriber = client.create(email: email, password: password) messages.info(subscriber.to_json) rescue Errors::BadRequest messages.bad_request rescue Errors::Unprocessable messages.unprocessable rescue Faraday::ConnectionFailed messages.no_service end document :info def info subscriber = client.info messages.info(subscriber.to_json) rescue Errors::SubscriberNotFound messages.not_found rescue Errors::Unauthorized messages.unauthorized rescue Faraday::ConnectionFailed messages.no_service end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
search-kit-0.0.5 | lib/search_kit/cli/subscribers.rb |