Module: Happy

Defined in:
lib/happy.rb,
lib/happy/errors.rb,
lib/happy/helpers.rb,
lib/happy/request.rb,
lib/happy/version.rb,
lib/happy/response.rb,
lib/happy/controller.rb,
lib/happy/helpers/html.rb,
lib/happy/helpers/i18n.rb,
lib/happy/extras/static.rb,
lib/happy/extras/scriptable.rb,
lib/happy/helpers/rendering.rb,
lib/happy/controller/actions.rb,
lib/happy/controller/routing.rb,
lib/happy/controller/rackable.rb,
lib/happy/extras/code_reloader.rb,
lib/happy/controller/permissions.rb,
lib/happy/controller/configurable.rb,
lib/happy/extras/action_controller.rb,
lib/happy/extras/resource_controller.rb,
lib/happy/request/date_parameter_converter.rb,
lib/happy/extras/active_model_resource_controller.rb

Defined Under Namespace

Modules: Errors, Extras, Helpers Classes: Controller, Request, Response

Constant Summary collapse

VERSION =
"0.1.0"

Class Method Summary collapse

Class Method Details

.envObject



15
16
17
# File 'lib/happy.rb', line 15

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

.route(&blk) ⇒ Object

Creates a new Happy::Controller class, using the provided block as its routing block.



22
23
24
25
26
# File 'lib/happy.rb', line 22

def self.route(&blk)
  Class.new(Happy::Controller).tap do |klass|
    klass.send(:define_method, :route, &blk)
  end
end