Class: SearchKit::Events::CLI::Complete
- Inherits:
-
Object
- Object
- SearchKit::Events::CLI::Complete
- Includes:
- Messaging
- Defined in:
- lib/search_kit/events/cli/complete.rb
Overview
An extraction of the CLI command, “complete”.
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
-
#initialize(client, id) ⇒ Complete
constructor
A new instance of Complete.
- #perform ⇒ Object
Methods included from Messaging
Constructor Details
#initialize(client, id) ⇒ Complete
13 14 15 16 |
# File 'lib/search_kit/events/cli/complete.rb', line 13 def initialize(client, id) @client = client @id = id end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
11 12 13 |
# File 'lib/search_kit/events/cli/complete.rb', line 11 def client @client end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
11 12 13 |
# File 'lib/search_kit/events/cli/complete.rb', line 11 def id @id end |
Instance Method Details
#perform ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/search_kit/events/cli/complete.rb', line 18 def perform client.complete(id) info "Event #{id} completed" rescue Errors::EventNotFound warning "No event found for #{id}" rescue Faraday::ConnectionFailed warning "Remote events service not found" rescue JSON::ParserError => error warning "Response unreadable: #{error}" error.backtrace.each(&method(:warning)) end |