README.md in http_headers-accept-0.1.0 vs README.md in http_headers-accept-0.2.0

- old
+ new

@@ -2,11 +2,11 @@ [![Build Status: master](https://travis-ci.com/XPBytes/http_headers-accept.svg)](https://travis-ci.com/XPBytes/http_headers-accept) [![Gem Version](https://badge.fury.io/rb/http_headers-accept.svg)](https://badge.fury.io/rb/http_headers-accept) [![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT) -Authorize a certain block with cancan +:nut_and_bolt: Utility to parse and sort the "Accept" HTTP Header ## Installation Add this line to your application's Gemfile: @@ -44,9 +44,22 @@ parsed.first[:foo] # => bar parsed.last.to_s # => '*/*; q=0.1' ``` + +Each parsed entry exposes the following methods: +- `media_type`: the parsed media_type +- `q`: the quality parameter as float, or 1.0 +- `[](parameter)`: accessor for the parameter; throws if it does not exist +- `to_s`: encode back to an entry to be used in a `Accept` header + +## Related + +- [HttpHeaders::Utils](https://github.com/XPBytes/http_headers-utils): :nut_and_bolt: Utility belt for the HttpHeader libraries +- [HttpHeaders::AcceptLanguage](https://github.com/XPBytes/http_headers-accept_language): :nut_and_bolt: Utility to parse and sort the "Accept-Language" HTTP Header +- [HttpHeaders::ContentType](https://github.com/XPBytes/http_headers-content_type): :nut_and_bolt: Utility to parse and sort the "Content-Type" HTTP Header + ## Development After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.