0.0
No commit activity in last 3 years
No release in over 3 years
A simple action object for Eldr
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.7
~> 10.0

Runtime

~> 0.0
 Project Readme

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