Skip to content

Commit

Permalink
change to Zx::Mixins
Browse files Browse the repository at this point in the history
  • Loading branch information
thadeu committed May 7, 2024
1 parent 54ab92a commit c3028db
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
13 changes: 7 additions & 6 deletions lib/zx.rb
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion lib/zx/mixin.rb → lib/zx/mixins.rb
Original file line number Diff line number Diff line change
@@ -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)) }

Expand Down
8 changes: 4 additions & 4 deletions lib/zx/result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit c3028db

Please sign in to comment.