Class: Groonga::Command::ColumnCreate

Inherits:
Base
  • Object
show all
Defined in:
lib/groonga/command/column-create.rb

Instance Attribute Summary

Attributes inherited from Base

#arguments, #name, #original_format, #original_source, #path_prefix

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#==, #[], #[]=, #command_format?, #initialize, #key?, #output_type, #to_command_format, #to_uri_format, #uri_format?

Constructor Details

This class inherits a constructor from Groonga::Command::Base

Class Method Details

.parameter_namesObject



27
28
29
30
31
32
33
34
35
# File 'lib/groonga/command/column-create.rb', line 27

def parameter_names
  [
    :table,
    :name,
    :flags,
    :type,
    :source,
  ]
end

Instance Method Details

#column_index?Boolean

Returns true if "COLUMN_INDEX" is specified in #flags, false otherwise.

Returns:

  • (Boolean)

    true if "COLUMN_INDEX" is specified in #flags, false otherwise.

Since:

  • 1.0.3



71
72
73
# File 'lib/groonga/command/column-create.rb', line 71

def column_index?
  flags.include?("COLUMN_INDEX")
end

#column_scalar?Boolean

Returns true if "COLUMN_SCALAR" is specified in #flags, false otherwise.

Returns:

  • (Boolean)

    true if "COLUMN_SCALAR" is specified in #flags, false otherwise.

Since:

  • 1.0.3



57
58
59
# File 'lib/groonga/command/column-create.rb', line 57

def column_scalar?
  flags.include?("COLUMN_SCALAR")
end

#column_vector?Boolean

Returns true if "COLUMN_VECTOR" is specified in #flags, false otherwise.

Returns:

  • (Boolean)

    true if "COLUMN_VECTOR" is specified in #flags, false otherwise.

Since:

  • 1.0.3



64
65
66
# File 'lib/groonga/command/column-create.rb', line 64

def column_vector?
  flags.include?("COLUMN_VECTOR")
end

#flagsObject



44
45
46
# File 'lib/groonga/command/column-create.rb', line 44

def flags
  @flags ||= (self[:flags] || "").split(/\s*\|\s*/)
end

#sources::Array<String>

Returns an array of index sources. If #source is empty or nil, this method returns an empty array.

Returns:

  • (::Array<String>)

    an array of index sources. If #source is empty or nil, this method returns an empty array.

Since:

  • 1.0.7



99
100
101
# File 'lib/groonga/command/column-create.rb', line 99

def sources
  @sources ||= (self[:source] || "").split(/\s*,\s*/)
end

#tableString

Returns table name.

Returns:

  • (String)

    table name.

Since:

  • 1.0.7



40
41
42
# File 'lib/groonga/command/column-create.rb', line 40

def table
  self[:table]
end

#typeString

Returns value type name of the column.

Returns:

  • (String)

    value type name of the column.

Since:

  • 1.0.7



50
51
52
# File 'lib/groonga/command/column-create.rb', line 50

def type
  self[:type]
end

#with_position?Boolean

Returns true if "WITH_POSITION" is specified in #flags, false otherwise.

Returns:

  • (Boolean)

    true if "WITH_POSITION" is specified in #flags, false otherwise.

Since:

  • 1.0.3



92
93
94
# File 'lib/groonga/command/column-create.rb', line 92

def with_position?
  flags.include?("WITH_POSITION")
end

#with_section?Boolean

Returns true if "WITH_SECTION" is specified in #flags, false otherwise.

Returns:

  • (Boolean)

    true if "WITH_SECTION" is specified in #flags, false otherwise.

Since:

  • 1.0.3



78
79
80
# File 'lib/groonga/command/column-create.rb', line 78

def with_section?
  flags.include?("WITH_SECTION")
end

#with_weight?Boolean

Returns true if "WITH_WEIGHT" is specified in #flags, false otherwise.

Returns:

  • (Boolean)

    true if "WITH_WEIGHT" is specified in #flags, false otherwise.

Since:

  • 1.0.3



85
86
87
# File 'lib/groonga/command/column-create.rb', line 85

def with_weight?
  flags.include?("WITH_WEIGHT")
end