Class: EventStoreClient::GRPC::Commands::Command
- Inherits:
-
Object
- Object
- EventStoreClient::GRPC::Commands::Command
show all
- Includes:
- Configuration
- Defined in:
- lib/event_store_client/adapters/grpc/commands/command.rb
Direct Known Subclasses
PersistentSubscriptions::Create, PersistentSubscriptions::Delete, PersistentSubscriptions::Read, PersistentSubscriptions::Update, Projections::Create, Projections::Delete, Projections::Update, Streams::Append, Streams::Delete, Streams::LinkTo, Streams::Read, Streams::ReadAll, Streams::Tombstone
Class Method Summary
collapse
Instance Method Summary
collapse
#config
Class Method Details
.inherited(klass) ⇒ Object
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/event_store_client/adapters/grpc/commands/command.rb', line 12
def self.inherited(klass)
super
klass.class_eval do
include Dry::Monads[:result]
def self.use_request(request_klass)
CommandRegistrar.register_request(self, request: request_klass)
end
def self.use_service(service_klass)
CommandRegistrar.register_service(self, service: service_klass)
end
def request
CommandRegistrar.request(self.class)
end
def service
CommandRegistrar.service(self.class)
end
end
end
|
Instance Method Details
35
36
37
38
39
|
# File 'lib/event_store_client/adapters/grpc/commands/command.rb', line 35
def metadata
credentials =
Base64.encode64("#{config.eventstore_user}:#{config.eventstore_password}")
{ 'authorization' => "Basic #{credentials.delete("\n")}" }
end
|