From c5fa819223a331c11302e2469fd14121442cef66 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Pacana?= Date: Fri, 10 Jun 2022 12:36:14 +0200 Subject: [PATCH] Code symmetry Join GetStream and GetEventsFromStream company. --- ruby_event_store-browser/lib/ruby_event_store/browser.rb | 2 +- ruby_event_store-browser/lib/ruby_event_store/browser/app.rb | 2 +- .../lib/ruby_event_store/browser/{event.rb => get_event.rb} | 2 +- ruby_event_store/spec/{event_spec.rb => get_event_spec.rb} | 0 4 files changed, 3 insertions(+), 3 deletions(-) rename ruby_event_store-browser/lib/ruby_event_store/browser/{event.rb => get_event.rb} (96%) rename ruby_event_store/spec/{event_spec.rb => get_event_spec.rb} (100%) diff --git a/ruby_event_store-browser/lib/ruby_event_store/browser.rb b/ruby_event_store-browser/lib/ruby_event_store/browser.rb index 18c9f35328..5ce23bacb6 100644 --- a/ruby_event_store-browser/lib/ruby_event_store/browser.rb +++ b/ruby_event_store-browser/lib/ruby_event_store/browser.rb @@ -8,7 +8,7 @@ module Browser end end -require_relative "browser/event" +require_relative "browser/get_event" require_relative "browser/json_api_event" require_relative "browser/get_events_from_stream" require_relative "browser/get_stream" diff --git a/ruby_event_store-browser/lib/ruby_event_store/browser/app.rb b/ruby_event_store-browser/lib/ruby_event_store/browser/app.rb index 3528f68399..834ab089cf 100644 --- a/ruby_event_store-browser/lib/ruby_event_store/browser/app.rb +++ b/ruby_event_store-browser/lib/ruby_event_store/browser/app.rb @@ -42,7 +42,7 @@ def initialize(event_store_locator:, related_streams_query:, host:, root_path:, def call(env) router = Router.new(routing) router.add_route("GET", "/api/events/:event_id") do |params| - json Event.new(event_store: event_store, event_id: params.fetch("event_id")) + json GetEvent.new(event_store: event_store, event_id: params.fetch("event_id")) end router.add_route("GET", "/api/streams/:stream_name") do |params, urls| json GetStream.new( diff --git a/ruby_event_store-browser/lib/ruby_event_store/browser/event.rb b/ruby_event_store-browser/lib/ruby_event_store/browser/get_event.rb similarity index 96% rename from ruby_event_store-browser/lib/ruby_event_store/browser/event.rb rename to ruby_event_store-browser/lib/ruby_event_store/browser/get_event.rb index f983db9238..84cc764360 100644 --- a/ruby_event_store-browser/lib/ruby_event_store/browser/event.rb +++ b/ruby_event_store-browser/lib/ruby_event_store/browser/get_event.rb @@ -2,7 +2,7 @@ module RubyEventStore module Browser - class Event + class GetEvent def initialize(event_store:, event_id:) @event_store = event_store @event_id = event_id diff --git a/ruby_event_store/spec/event_spec.rb b/ruby_event_store/spec/get_event_spec.rb similarity index 100% rename from ruby_event_store/spec/event_spec.rb rename to ruby_event_store/spec/get_event_spec.rb