Class: Syntropy::Markdown::Controller
- Inherits:
-
Object
- Object
- Syntropy::Markdown::Controller
- Defined in:
- lib/syntropy/markdown.rb
Instance Method Summary collapse
-
#initialize(env, atts, md) ⇒ Controller
constructor
A new instance of Controller.
- #to_proc ⇒ Object
Constructor Details
#initialize(env, atts, md) ⇒ Controller
Returns a new instance of Controller.
16 17 18 19 20 21 |
# File 'lib/syntropy/markdown.rb', line 16 def initialize(env, atts, md) @env = env @atts = atts @md = md @module_loader = env[:module_loader] end |
Instance Method Details
#to_proc ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/syntropy/markdown.rb', line 23 def to_proc ->(req) { case req.method when 'head' req.respond_html(nil) when 'get' md = html = render(md) req.respond_html(html) else req.respond(nil, ':status' => HTTP::METHOD_NOT_ALLOWED) end } end |