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 56106db commit 8dad647
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ end

# Instantiating it runs the validations.
me = Person.new(name: 'Robb')
you = Person.new(name: '') # => ArgumentError: "Name can't be blank"
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 All @@ -26,7 +26,7 @@ Note how Person's two lines of code are nothing new: `attr_reader` is standard R
* Clean, minimal syntax

This is a small layer around
[ActiveModel::Validations](http://api.rubyonrails.org/classes/ActiveModel/Validations/ClassMethods.html#method-i-validates). (About 25 lines of code.) So if you know how to use Rails Validations, you're good to go. I wrote this to help with CSV data imports and [website structured data](https://github.com/dogweather/schema-dot-org).
[ActiveModel::Validations](http://api.rubyonrails.org/classes/ActiveModel/Validations/ClassMethods.html#method-i-validates). (About 25 lines of code.) So if you know how to use [Rails Validations](https://guides.rubyonrails.org/active_record_validations.html), you're good to go. I wrote this to help with CSV data imports and [website structured data](https://github.com/dogweather/schema-dot-org).


## Usage
Expand Down

0 comments on commit 8dad647

Please sign in to comment.