README.md in attribute_extras-1.0.0 vs README.md in attribute_extras-1.0.1

- old
+ new

@@ -1,11 +1,11 @@ # AttributeExtras -[![Build Status](https://travis-ci.org/kddeisz/attribute_extras.svg?branch=master)](https://travis-ci.org/kddeisz/attribute_extras) +[![Build Status](https://github.com/kddnewton/attribute_extras/workflows/Main/badge.svg)](https://github.com/kddnewton/attribute_extras/actions) [![Gem](https://img.shields.io/gem/v/attribute_extras.svg)](https://rubygems.org/gems/attribute_extras) -Use this gem for automatic behavior on attributes performed before validation. You can use the predefined macros or define your own. +Use this gem for automatic behavior on attributes performed before validation. You can use the predefined extras or define your own. ## Installation Add this line to your application's Gemfile: @@ -74,16 +74,16 @@ person = Person.new(name: 'a' * 500) person.truncate_attributes person.name # => 'a' * limit ``` -### `AttributeExtras::define_macro` +### `AttributeExtras::define_extra` -You can define your own macros by using the `define_macro` method on the `AttributeExtras` module. `define_macro` a name for the macro and a block which itself accepts three arguments (the record being modified, the attribute being modified, and the value of the attribute). The block should return the modified value. An example would be: +You can define your own extras by using the `define_extra` method on the `AttributeExtras` module. `define_extra` takes a name for the extra and a block which itself accepts three arguments (the record being modified, the attribute being modified, and the value of the attribute). The block should return the modified value. An example would be: ```ruby -AttributeExtras.define_macro :double_attributes do |_record, _attribute, value| +AttributeExtras.define_extra :double_attributes do |_record, _attribute, value| value * 2 end class Person < ActiveRecord::Base double_attributes :age @@ -103,10 +103,10 @@ To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org). ## Contributing -Bug reports and pull requests are welcome on GitHub at https://github.com/kddeisz/attribute_extras. +Bug reports and pull requests are welcome on GitHub at https://github.com/kddnewton/attribute_extras. ## License The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).