Module: Sinatra::Twilio

Defined in:
lib/sinatra/twilio.rb,
lib/sinatra/twilio/response.rb

Defined Under Namespace

Modules: Helpers Classes: Response

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.registered(app) ⇒ Object



20
21
22
# File 'lib/sinatra/twilio.rb', line 20

def self.registered(app)
  app.helpers Helpers
end

Instance Method Details

#respond(route, conditions = {}, &block) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/sinatra/twilio.rb', line 9

def respond(route, conditions = {}, &block)
  action = Proc.new do
    twilio = Response.new(self)
    twilio.instance_eval &block if block_given?
    twilio.respond
  end

  get  route, conditions, &action
  post route, conditions, &action
end