Class: Droonga::Catalog::Schema::Column
- Inherits:
-
Object
- Object
- Droonga::Catalog::Schema::Column
- Defined in:
- lib/droonga/catalog/schema.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
-
#index_options ⇒ Object
readonly
Returns the value of attribute index_options.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#table ⇒ Object
readonly
Returns the value of attribute table.
-
#vector_options ⇒ Object
readonly
Returns the value of attribute vector_options.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(table, name, data) ⇒ Column
constructor
A new instance of Column.
- #type ⇒ Object
- #type_symbol ⇒ Object
- #value_type ⇒ Object
- #value_type_groonga ⇒ Object
Constructor Details
#initialize(table, name, data) ⇒ Column
Returns a new instance of Column.
55 56 57 58 59 60 61 |
# File 'lib/droonga/catalog/schema.rb', line 55 def initialize(table, name, data) @table = table @name = name @data = data @vector_options = ColumnVectorOptions.new() @index_options = ColumnIndexOptions.new() end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
54 55 56 |
# File 'lib/droonga/catalog/schema.rb', line 54 def data @data end |
#index_options ⇒ Object (readonly)
Returns the value of attribute index_options.
54 55 56 |
# File 'lib/droonga/catalog/schema.rb', line 54 def @index_options end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
54 55 56 |
# File 'lib/droonga/catalog/schema.rb', line 54 def name @name end |
#table ⇒ Object (readonly)
Returns the value of attribute table.
54 55 56 |
# File 'lib/droonga/catalog/schema.rb', line 54 def table @table end |
#vector_options ⇒ Object (readonly)
Returns the value of attribute vector_options.
54 55 56 |
# File 'lib/droonga/catalog/schema.rb', line 54 def @vector_options end |
Instance Method Details
#==(other) ⇒ Object
63 64 65 66 67 |
# File 'lib/droonga/catalog/schema.rb', line 63 def ==(other) self.class == other.class and name == other.name and data == other.data end |
#type ⇒ Object
69 70 71 |
# File 'lib/droonga/catalog/schema.rb', line 69 def type @data["type"] || "Scalar" end |
#type_symbol ⇒ Object
73 74 75 76 77 78 79 80 81 82 |
# File 'lib/droonga/catalog/schema.rb', line 73 def type_symbol case type when "Scalar" :scalar when "Vector" :vector when "Index" :index end end |
#value_type ⇒ Object
84 85 86 |
# File 'lib/droonga/catalog/schema.rb', line 84 def value_type @data["valueType"] end |
#value_type_groonga ⇒ Object
88 89 90 91 92 93 94 |
# File 'lib/droonga/catalog/schema.rb', line 88 def value_type_groonga if value_type == "Integer" "Int64" else value_type end end |