README.md in sinclair-1.5.2 vs README.md in sinclair-1.6.0

- old
+ new

@@ -2,31 +2,33 @@ ======== [![Code Climate](https://codeclimate.com/github/darthjee/sinclair/badges/gpa.svg)](https://codeclimate.com/github/darthjee/sinclair) [![Test Coverage](https://codeclimate.com/github/darthjee/sinclair/badges/coverage.svg)](https://codeclimate.com/github/darthjee/sinclair/coverage) [![Issue Count](https://codeclimate.com/github/darthjee/sinclair/badges/issue_count.svg)](https://codeclimate.com/github/darthjee/sinclair) [![Gem Version](https://badge.fury.io/rb/sinclair.svg)](https://badge.fury.io/rb/sinclair) +[![Codacy Badge](https://api.codacy.com/project/badge/Grade/9836de08612e46b889c7978be2b72a14)](https://www.codacy.com/manual/darthjee/sinclair?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=darthjee/sinclair&amp;utm_campaign=Badge_Grade) +[![Inline docs](http://inch-ci.org/github/darthjee/sinclair.svg?branch=master)](http://inch-ci.org/github/darthjee/sinclair) - ![sinclair](https://raw.githubusercontent.com/darthjee/sinclair/master/sinclair.jpg) This gem helps the creation of complex gems/concerns that enables creation of methods on the fly through class methods Yard Documentation ------------------- -https://www.rubydoc.info/gems/sinclair/1.5.2 +[https://www.rubydoc.info/gems/sinclair/1.6.0](https://www.rubydoc.info/gems/sinclair/1.6.0) Installation --------------- - - Install it +- Install it + ```ruby gem install sinclair ``` - - Or add Sinclair to your `Gemfile` and `bundle install`: +- Or add Sinclair to your `Gemfile` and `bundle install`: ```ruby gem 'sinclair' ``` @@ -34,17 +36,16 @@ bundle install sinclair ``` Usage --------------- -# Sinclair +### Sinclair builder Sinclair can actually be used in several ways, as a stand alone object capable of adding methods to your class on the fly, as a builder inside a class method or by extending it for more complex logics -## Stand Alone usage creating methods on the fly: - +#### Stand Alone usage creating methods on the fly ```ruby class Clazz end @@ -63,11 +64,11 @@ puts "One Hundred => #{Clazz.one_hundred}" # One Hundred => 100 puts "One Hundred => #{Clazz.one_hundred_twenty}" # One Hundred Twenty => 120 ``` -## Builder in class method: +#### Builder in class method ```ruby class HttpJsonModel attr_reader :json @@ -160,11 +161,11 @@ MyServerConfig.host # returns 'myserver.com' MyServerConfig.port # returns '9090' ``` -## Extending the builder +#### Extending the builder ```ruby class ValidationBuilder < Sinclair delegate :expected, to: :options_object @@ -253,11 +254,11 @@ legs: 2 ) invalid_object.valid? # returns false ``` -## Caching the result +#### Caching the result If wanted, the result of the method can be stored in an instance variable with the same name. When caching, you can cache with type `:full` so that even `nil` values are cached @@ -342,11 +343,11 @@ server.host = nil server.port = nil server.url # return 'http://server.com' ``` -# Sinclair::Configurable +### Sinclair::Configurable Configurable is a module that, when used, can add configurations to your classes/modules. Configurations are read-only objects that can only be set using @@ -406,11 +407,11 @@ end Client.config.url # returns 'http://interstella.com:8080' ``` -# Sinclair::Settable +### Sinclair::Settable Settable allows classes to extract configuration from environments through a simple meta-programable way ```ruby @@ -525,7 +526,6 @@ ``` Projects Using --------------- -- [Arstotzka](https://github.com/darthjee/arstotzka) - +- [Arstotzka](https://github.com/darthjee/arstotzka)