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: ClassMethods, InstanceMethods

Class Method Summary collapse

Class Method Details

.included(receiver) ⇒ Object



208
209
210
211
# File 'lib/lunetas/candy.rb', line 208

def self.included(receiver)
  receiver.send :include, InstanceMethods
  receiver.send :extend, ClassMethods
end