Skip to content

Commit

Permalink
Fix Operations documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
k-dubil authored and flash-gordon committed Jul 7, 2024
1 parent 105fe77 commit eaa2011
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions docsite/source/operations.html.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ end

is_number.call(1).success? # => true
is_number.call(2.0).success? # => true
is_number.call('3').success? # => false
is_number.call('3').success? # => true
is_number.call('four').success? # => false
```

Expand Down Expand Up @@ -98,9 +98,9 @@ is_middle_aged = build do
gt?(30) & lt?(50)
end

is_child.call(20).success? # => false
is_child.call(40).success? # => true
is_child.call(60).success? # => true
is_middle_aged.call(20).success? # => false
is_middle_aged.call(40).success? # => true
is_middle_aged.call(60).success? # => false
```

### Attribute (`attr`)
Expand Down Expand Up @@ -138,10 +138,10 @@ is_only_odd.call([4, 6, 8]).success? # => false
``` ruby
is_natural_and_odd = build do
set(int?, odd?, gt?(1))
set { [int?, odd?, gt?(1)] }
end

is_natural_and_odd.call('5').success? # => false
is_natural_and_odd.call('5').success? # => NoMethodError: undefined method `odd?' for "5":String
is_natural_and_odd.call(5).success? # => true
is_natural_and_odd.call(-1).success? # => false
```
Expand All @@ -152,7 +152,7 @@ is_natural_and_odd.call(-1).success? # => false
``` ruby
is_present = build do
negation(empty?)
negation { empty? }
end

is_present.call([1]).success? # => true
Expand All @@ -166,7 +166,7 @@ is_present.call("").success? # => false
``` ruby
is_named = build do
key name: [:user, :name] do
str? & negation(empty?)
str? & negation { empty? }
end
end

Expand Down

0 comments on commit eaa2011

Please sign in to comment.