Navigation Menu

Skip to content

Commit

Permalink
schema: Add Droonga::Catalog::Schema
Browse files Browse the repository at this point in the history
  • Loading branch information
darashi committed Feb 19, 2014
1 parent 7e17eaf commit 69fa945
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/droonga/catalog/base.rb
Expand Up @@ -16,13 +16,14 @@
require "digest/sha1"
require "zlib"
require "time"
require "droonga/catalog/schema"
require "droonga/message_processing_error"
require "droonga/catalog/errors"

module Droonga
module Catalog
class Base
attr_reader :path, :base_path
attr_reader :path, :base_path, :schema
def initialize(data, path)
@data = data
@path = path
Expand All @@ -47,6 +48,7 @@ def initialize(data, path)
dataset["continuum"] = continuum.sort do |a, b| a[0] - b[0]; end
end
@options = @data["options"] || {}
@schema = Droonga::Catalog::Schema.new(@data["schema"])
end

def option(name)
Expand Down
26 changes: 26 additions & 0 deletions lib/droonga/catalog/schema.rb
@@ -0,0 +1,26 @@
# Copyright (C) 2014 Droonga Project
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License version 2.1 as published by the Free Software Foundation.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA

module Droonga
module Catalog
class Schema
def initialize(data)
@data = data
end

# TODO provide useful methods
end
end
end

0 comments on commit 69fa945

Please sign in to comment.