Skip to content

Commit

Permalink
require all lib files after module definition
Browse files Browse the repository at this point in the history
  • Loading branch information
AnotherRegularDude committed Dec 15, 2024
1 parent ce03d81 commit 5f9edf5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
7 changes: 4 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,18 +65,17 @@ Descendants of a parent, into which initializer logic has already been imported,
You can use both providers for a different services:

```ruby

# Types is a namespace for all types, defined by smart_types.
class FirstService < Resol::Service
inject_initializer :smartcore
inject_initializer :smartcore_injector

param :first, Types::String
param :second, Types::Integer
end

# Types is a namespace for all types, defined by dry-types.
class SecondService < Resol::Service
inject_initializer :dry
inject_initializer :dry_injector

param :first, Types::Strict::String
param :second, Types::Strict::Integer
Expand All @@ -86,6 +85,8 @@ end
Both initializers support inheritance. And base features for initialization flow
like default value, arguments accessors visibility level, coercible attributes and so on.

List of all supported initializers you can see at `DependencyContainer` definition.

#### Return a result

**Note** – calling `success!`/`fail!` methods interrupts `call` method execution.
Expand Down
12 changes: 12 additions & 0 deletions lib/resol/result.rb
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,16 @@ def bind = self

alias fmap bind
end

# TODO: Should be in a module, which includes in classes.
# Example;
# rubocop:disable Naming/MethodName
def Success(...)
Success.new(...)
end

def Failure(...)
Failure.new(...)
end
# rubocop:enable Naming/MethodName
end

0 comments on commit 5f9edf5

Please sign in to comment.