Sha256: 0fef24d5f531e53305388349737c9e3cb28df82519dc99010a57e9d7504e3840

Contents?: true

Size: 1.07 KB

Versions: 8

Compression:

Stored size: 1.07 KB

Contents

# ExplicitParameters

[![Build Status](https://secure.travis-ci.org/byroot/explicit-parameters.png)](http://travis-ci.org/byroot/explicit-parameters)
[![Gem Version](https://badge.fury.io/rb/explicit-parameters.png)](http://badge.fury.io/rb/explicit-parameters)


Explicit parameters validation and casting for Rails APIs.

## Installation

Add this line to your application's Gemfile:

```ruby
gem 'explicit-parameters'
```

And then execute:

    $ bundle

## Usage

Example:

```ruby
class DummyController < ApiController
  params do
    requires :search, String
    accepts :limit, Integer, default: 30

    validates :limit, :numericality: {greater_than: 0, less_than_or_equal_to: 100}
  end
  def index
    Dummy.search(params.search).limit(params.limit)
  end
end
```

## TODO

- Real README

## Contributing

1. Fork it ( https://github.com/byroot/explicit_parameters/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
explicit-parameters-0.4.1 README.md
explicit-parameters-0.4.0 README.md
explicit-parameters-0.3.0 README.md
explicit-parameters-0.2.0 README.md
explicit-parameters-0.1.1 README.md
explicit-parameters-0.1.0 README.md
explicit-parameters-0.0.3 README.md
explicit-parameters-0.0.2 README.md