diff --git a/lib/zx.rb b/lib/zx.rb index 3b6d20a..39531c6 100644 --- a/lib/zx.rb +++ b/lib/zx.rb @@ -1,10 +1,11 @@ # frozen_string_literal: true +require 'zx/version' +require 'zx/fmap' +require 'zx/given' +require 'zx/mixins' +require 'zx/reflect' +require 'zx/result' + module Zx - require 'zx/version' - require 'zx/fmap' - require 'zx/given' - require 'zx/mixin' - require 'zx/reflect' - require 'zx/result' end diff --git a/lib/zx/mixin.rb b/lib/zx/mixins.rb similarity index 97% rename from lib/zx/mixin.rb rename to lib/zx/mixins.rb index 092389a..b1b3880 100644 --- a/lib/zx/mixin.rb +++ b/lib/zx/mixins.rb @@ -1,7 +1,7 @@ # frozen_string_literal: true module Zx - module Mixin + module Mixins Success = ->(value = nil, options = {}) { Success(value, { type: :ok }.merge(options)) } Failure = ->(value = nil, options = {}) { Failure(value, { type: :error }.merge(options)) } diff --git a/lib/zx/result.rb b/lib/zx/result.rb index df570ec..9f53564 100644 --- a/lib/zx/result.rb +++ b/lib/zx/result.rb @@ -103,10 +103,10 @@ def success!(value = nil, type: :ok) self end - include ::Zx::Mixin - extend ::Zx::Mixin + include ::Zx::Mixins + extend ::Zx::Mixins end - include ::Zx::Mixin - extend ::Zx::Mixin + include ::Zx::Mixins + extend ::Zx::Mixins end