README.md in u-attributes-0.7.0 vs README.md in u-attributes-0.8.0

- old
+ new

@@ -78,10 +78,36 @@ person = Person.new('name' => 'John', age: 20) puts person.name # John puts person.age # 20 + +#--------------# +# #attribute() # +#--------------# +# +# Use the #attribute() method with a valid attribute name to get its value + +puts person.attribute(:name) # John +puts person.attribute('age') # 20 +puts person.attribute('foo') # nil + +# +# If you pass a block, it will be executed only if the attribute is valid. + +person.attribute(:name) { |value| puts value } # John +person.attribute('age') { |value| puts value } # 20 +person.attribute('foo') { |value| puts value } # !! Nothing happened, because of the attribute not exists. + +#--------------# +# #attribute() # +#--------------# +# +# Works like the #attribute() method, but will raise an exception when the attribute not exist. + +puts person.attribute!('foo') # NameError (undefined attribute `foo) +person.attribute!('foo') { |value| puts value } # NameError (undefined attribute `foo) ``` ### How to define multiple attributes? ```ruby @@ -247,14 +273,14 @@ 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/[USERNAME]/micro-attributes. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. +Bug reports and pull requests are welcome on GitHub at https://github.com/serradura/u-attributes. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct. ## License The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT). ## Code of Conduct -Everyone interacting in the Micro::Attributes project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/[USERNAME]/micro-attributes/blob/master/CODE_OF_CONDUCT.md). +Everyone interacting in the Micro::Attributes project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the [code of conduct](https://github.com/serradura/u-attributes/blob/master/CODE_OF_CONDUCT.md).