Sha256: 27094c02b95c1914d02e4c8410f05da9d4337e8143be87c635f628579d2f8c7b
Contents?: true
Size: 770 Bytes
Versions: 31
Compression:
Stored size: 770 Bytes
Contents
require 'rubygems' require 'innate' require 'yaml' ARTICLES = { 'hello' => { :author => 'manveru', :title => 'Hello, World!', :text => 'Some text' } } class BlogArticles Innate.node('/') # provide a content representation for requests to /<action>.yaml # If you request `/list.yaml`, you will get the `ARTICLES object serialized # to YAML. provide(:yaml, :type => 'text/yaml'){|action, value| value.to_yaml } # Since there will always be an `html` representation (the default), you have # to take care of it. If you simply want to return an empty page, use following. provide(:html){|action, value| '' } # The return value of this method is the `value` in the provides above. def list return ARTICLES end end Innate.start
Version data entries
31 entries across 31 versions & 3 rubygems