Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dogweather authored May 2, 2024
1 parent f145f06 commit c9a5bcd
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ class Person < ValidatedObject::Base
end

# Instantiating it runs the validations.
me = Person.new(name: 'Robb')
me = Person.new(name: 'Robb')
you = Person.new(name: '') # => "ArgumentError: Name can't be blank"
```

Note how Person's two lines of code are nothing new: `attr_reader` is standard Ruby. [`validates`](https://guides.rubyonrails.org/active_record_validations.html) is standard Rails. I use classes like these as Data Transfer Objects at my system boundaries.
Expand Down

0 comments on commit c9a5bcd

Please sign in to comment.