FastAttributes::UUID
Overview
This gem adds support of UUID
type to fast_attributes
gem
Installation
Add this line to your application's Gemfile:
gem 'fast_attributes'
gem 'fast_attributes-uuid'
And then execute:
$ bundle
Or install it yourself as:
$ gem install fast_attributes fast_attributes-uuid
Usage
require 'fast_attributes'
require 'fast_attributes/uuid'
class Request
extend FastAttributes
attribute :id, UUIDTools::UUID
end
request = Request.new
request.id = '479c4718-06d0-4712-b79d-eea7170938c8'
# => #<UUID:0x3ff8a1a0a684 UUID:479c4718-06d0-4712-b79d-eea7170938c8>
request.id = 'EFC0CCF6E72243958306D816AB82BAB7'
# => #<UUID:0x3ff8a19db924 UUID:efc0ccf6-e722-4395-8306-d816ab82bab7>
request.id = UUIDTools::UUID.parse('4e79aff3-1f04-4fea-bebf-694625551a92')
# => #<UUID:0x3ff8a19c3d24 UUID:4e79aff3-1f04-4fea-bebf-694625551a92>
Contributing
- Fork it ( https://github.com/applift/fast_attributes-uuid/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request