Module: Lunetas::Candy

Defined in:
lib/lunetas/candy.rb

Overview

This module should be included in any resource that should be exposed with an API. Then the method matches should be called in order to register the path for this resource.

Examples:

Simple example

class Testing
  include Lunetas::Candy
  matches '/test'

  def get
    "This is what I answer then calling GET '/test'"
  end
end

Defined Under Namespace

Modules: Initialization, MethodStrategy, RequestWrapper, ResponseHandler, TemplateParsing

Class Method Summary collapse

Class Method Details

.included(receiver) ⇒ Object



22
23
24
25
26
27
28
29
30
# File 'lib/lunetas/candy.rb', line 22

def self.included(receiver)
  receiver.send :include, Initialization::InstanceMethods
  receiver.send :extend,  Initialization::ClassMethods
  receiver.send :include, MethodStrategy::InstanceMethods
  receiver.send :include, RequestWrapper::InstanceMethods
  receiver.send :include, ResponseHandler::InstanceMethods
  receiver.send :extend,  ResponseHandler::ClassMethods
  receiver.send :include, TemplateParsing::InstanceMethods
end