CirrusMio/ainsleytwo — pull request #27 by nuex (2014-03-20 06:51:53+00:00)
Title: example of using say as an extension

An example web extension for AinsleyTwo (Say).

Probably need some doco for this added to the PR, but I'll just type it into here for now:

```
# Writing an extension
class Hi
extend AinsleyTwo::Extension

# These are the classes (denoted by symbols) that you are going
# to inject into AinsleyTwo
def self.absorbables
[:web]
end

module Web
# This is the callback we're using to do more stuff
# for AinsleyTwo.
# AinsleyTwo will know what arguments to pass into
# this callback based on the absorbable type.
#
# Here, app, is a Sinatra web app passed in by AinsleyTwo
def self.absorb(app)
app.get('/hi') do
'hi'
end
end
end
end

AinsleyTwo.absorb(Hi)