You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
devdocs/lib/docs/core/page_db.rb

26 lines
331 B

require 'yajl/json_gem'
module Docs
class PageDb
attr_reader :pages
delegate :empty?, :blank?, to: :pages
def initialize
@pages = {}
end
def add(path, content)
@pages[path] = content
end
def as_json
@pages
end
def to_json
JSON.generate(as_json)
end
end
end