Class: Groonga::Client::Request::ValuesParameter
- Inherits:
-
Object
- Object
- Groonga::Client::Request::ValuesParameter
- Defined in:
- lib/groonga/client/request/generic.rb
Direct Known Subclasses
Select::BackwardCompatibleSortKeysParameter, Select::OutputColumnsParameter, Select::SortKeysParameter
Instance Method Summary collapse
-
#initialize(names, values) ⇒ ValuesParameter
constructor
A new instance of ValuesParameter.
- #to_parameters ⇒ Object
Constructor Details
#initialize(names, values) ⇒ ValuesParameter
Returns a new instance of ValuesParameter.
129 130 131 132 |
# File 'lib/groonga/client/request/generic.rb', line 129 def initialize(names, values) @names = names @values = values end |
Instance Method Details
#to_parameters ⇒ Object
134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/groonga/client/request/generic.rb', line 134 def to_parameters case @values when ::Array return {} if @values.empty? values = @values.collect(&:to_s).join(", ") when Symbol values = @values.to_s when String return {} if /\A\s*\z/ === @values values = @values when NilClass return {} else values = @values end parameters = {} @names.each do |name| parameters[name] = values end parameters end |