Skip to content

eldr-rb/eldr-action

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Eldr::Action

A simple action object for Eldr. You can include it and make any class compatible with an Eldr route. You'll get validations and params for free. Eldr::Action's respond to call(env) and return a valid rack response.

Installation

Add this line to your application's Gemfile:

gem 'eldr-action'

And then execute:

$ bundle

Or install it yourself as:

$ gem install eldr-action

Usage

Just extend it:

module Cats
  class Show < Eldr::Action
    def call(env)
      @env = env

      Rack::Response.new 'Found the cat!'
    end
  end
end

Then pass it to a route in an Eldr::App:

class App < Eldr::App
  get '/', Cats::Show.new
end

About

A simple action object for Eldr

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages