Sha256: 7ca5d143feac81860cbc5f3fb2a110176d7a71f137e1ee77c06e9aa8e9e81abb

Contents?: true

Size: 431 Bytes

Versions: 6

Compression:

Stored size: 431 Bytes

Contents

require 'rack'
require 'happy/version'
require 'happy/errors'
require 'happy/controller'

module Happy
  def self.env
    ActiveSupport::StringInquirer.new(ENV['RACK_ENV'] || 'development')
  end

  # Creates a new Happy::Controller class, using the provided block as
  # its routing block.
  #
  def self.route(&blk)
    Class.new(Happy::Controller).tap do |klass|
      klass.send(:define_method, :route, &blk)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
happy-0.1.0.pre25 lib/happy.rb
happy-0.1.0.pre24 lib/happy.rb
happy-0.1.0.pre23 lib/happy.rb
happy-0.1.0.pre22 lib/happy.rb
happy-0.1.0.pre21 lib/happy.rb
happy-0.1.0.pre20 lib/happy.rb