Skip to content

Commit

Permalink
misc: Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vincent-pochet committed Nov 5, 2024
1 parent 4ca7018 commit 0e35b4d
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ bundle install
### Basic usage:

```ruby
class MyService < Turbine::Base
class MyService < Turbine::Service::Base
def initialize(my_args)
@my_args = my_args

Expand All @@ -40,13 +40,13 @@ end
result = MyService.call(my_args)
result.success? # => true
result.failure? # => false
result.raise_if_error! # => Turbine::Result instance
result.raise_if_error! # => Turbine::Service::Result instance
```

### With failures

```ruby
class MyService < Turbine::Base
class MyService < Turbine::Service::Base
def initialize(my_args)
@my_args = my_args

Expand Down Expand Up @@ -78,8 +78,8 @@ result.raise_if_error! # => raises Turbine::ServiceFailure
### With data attached to the result

```ruby
class MyService < Turbine::Base
class Result < Turbine::Result
class MyService < Turbine::Service::Base
class Result < Turbine::Service::Result
attr_accessor :my_data
end

Expand Down

0 comments on commit 0e35b4d

Please sign in to comment.