README.md in lite-service-1.0.0 vs README.md in lite-service-1.0.1
- old
+ new
@@ -33,18 +33,18 @@
Learn more about using memoization subclass in [Lite::Memoize](https://github.com/drexed/lite-memoize)
and errors subclass [Lite::Errors](https://github.com/drexed/lite-errors).
```ruby
-class SearchMovies
- prepend Lite::Service::Command
+class SearchMovies < Lite::Service::Command
def initialize(name)
@name = name
end
- def call
+ # NOTE: This method is required to call the command
+ def run
{ generate_fingerprint => movies_by_name }
end
private
@@ -68,15 +68,16 @@
```ruby
service = SearchMovies.new('Toy Story')
service.called? #=> false
service.call #=> { 'fingerprint_1' => [ 'Toy Story 1', ... ] }
service.called? #=> true
+service.run #=> Returns a fresh uncached value
# or
service = SearchMovies.call('Toy Story')
service.called? #=> true
-service.result #=> { 'fingerprint_1' => [ 'Toy Story 2', ... ] }
+service.result #=> { 'fingerprint_1' => [ 'Toy Story 1', ... ] }
```
**Cache**
```ruby