Class: Groonga::Command::QueryExpand

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

Overview

A command class that represents query_expand command.

Since:

  • 1.2.1

Instance Attribute Summary

Attributes inherited from Base

#arguments, #command_name, #original_format, #original_source, #path_prefix

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

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

Constructor Details

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

Class Method Details

.parameter_namesObject

Since:

  • 1.2.1



28
29
30
31
32
33
34
# File 'lib/groonga/command/query-expand.rb', line 28

def parameter_names
  [
    :expander,
    :query,
    :flags,
  ]
end

Instance Method Details

#allow_column?Boolean

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

Returns:

  • (Boolean)

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

Since:

  • 1.2.1



70
71
72
# File 'lib/groonga/command/query-expand.rb', line 70

def allow_column?
  flags.include?("ALLOW_COLUMN")
end

#allow_leading_not?Boolean

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

Returns:

  • (Boolean)

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

Since:

  • 1.2.1



86
87
88
# File 'lib/groonga/command/query-expand.rb', line 86

def allow_leading_not?
  flags.include?("ALLOW_LEADING_NOT")
end

#allow_pragma?Boolean

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

Returns:

  • (Boolean)

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

Since:

  • 1.2.1



62
63
64
# File 'lib/groonga/command/query-expand.rb', line 62

def allow_pragma?
  flags.include?("ALLOW_PRAGMA")
end

#allow_update?Boolean

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

Returns:

  • (Boolean)

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

Since:

  • 1.2.1



78
79
80
# File 'lib/groonga/command/query-expand.rb', line 78

def allow_update?
  flags.include?("ALLOW_UPDATE")
end

#expanderString

Returns expander parameter value.

Returns:

  • (String)

    expander parameter value.

Since:

  • 1.2.1



40
41
42
# File 'lib/groonga/command/query-expand.rb', line 40

def expander
  self[:expander]
end

#flagsArray<String>

Returns flags parameter value.

Returns:

  • (Array<String>)

    flags parameter value.

Since:

  • 1.2.1



54
55
56
# File 'lib/groonga/command/query-expand.rb', line 54

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

#none?Boolean

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

Returns:

  • (Boolean)

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

Since:

  • 1.2.1



94
95
96
# File 'lib/groonga/command/query-expand.rb', line 94

def none?
  flags.include?("NONE")
end

#queryString

Returns query parameter value.

Returns:

  • (String)

    query parameter value.

Since:

  • 1.2.1



47
48
49
# File 'lib/groonga/command/query-expand.rb', line 47

def query
  self[:query]
end