Skip to content

Commit

Permalink
Added docs for StripAttributes.strip method usage patterns
Browse files Browse the repository at this point in the history
Ref #26
  • Loading branch information
rmm5t committed Jan 23, 2015
1 parent 22eb3e5 commit ebce66d
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,17 @@ end

```

### Using it directly

```ruby
# where record is an ActiveModel isntance
StripAttributes.strip(record, :collapse_spaces => true)

# works directly on Strings too
StripAttributes.strip(" foo \t") #=> "foo"
StripAttributes.strip(" foo bar", :collapse_spaces => true) #=> "foo bar"
```

## Testing

StripAttributes provides an RSpec/Shoulda-compatible matcher for easier
Expand Down

0 comments on commit ebce66d

Please sign in to comment.