Navigation Menu

Skip to content

Commit

Permalink
schema: Add ColumnIndexOptions class
Browse files Browse the repository at this point in the history
  • Loading branch information
darashi committed Feb 19, 2014
1 parent bde6b0e commit aae308c
Showing 1 changed file with 25 additions and 1 deletion.
26 changes: 25 additions & 1 deletion lib/droonga/catalog/schema.rb
Expand Up @@ -16,18 +16,42 @@
module Droonga
module Catalog
class Schema
class ColumnIndexOptions
def initialize(data)
@data = data
end

def with_section
@data["withSection"]
end

def with_weight
@data["withWeight"]
end

def with_position
@data["withPosition"]
end
end

class Column
attr_reader :name, :data
attr_reader :name, :data, :index_options
def initialize(name, data)
@name = name
@data = data
@index_options = ColumnIndexOptions.new(index_options_data)
end

def ==(other)
self.class == other.class and
name == other.name and
data == other.data
end

private
def index_options_data
@data["index_options"] || {}
end
end

class Table
Expand Down

0 comments on commit aae308c

Please sign in to comment.