Class: Fluent::GroongaOutput::Schema::TypeGuesser
- Inherits:
-
Object
- Object
- Fluent::GroongaOutput::Schema::TypeGuesser
- Defined in:
- lib/fluent/plugin/out_groonga.rb
Instance Method Summary collapse
- #guess ⇒ Object
-
#initialize(sample_values) ⇒ TypeGuesser
constructor
A new instance of TypeGuesser.
- #vector? ⇒ Boolean
Constructor Details
#initialize(sample_values) ⇒ TypeGuesser
401 402 403 |
# File 'lib/fluent/plugin/out_groonga.rb', line 401 def initialize(sample_values) @sample_values = sample_values end |
Instance Method Details
#guess ⇒ Object
405 406 407 408 409 410 411 412 413 414 415 |
# File 'lib/fluent/plugin/out_groonga.rb', line 405 def guess return "Time" if time_values? return "Int32" if int32_values? return "Int64" if int64_values? return "Float" if float_values? return "WGS84GeoPoint" if geo_point_values? return "LongText" if long_text_values? return "Text" if text_values? "ShortText" end |
#vector? ⇒ Boolean
417 418 419 420 421 |
# File 'lib/fluent/plugin/out_groonga.rb', line 417 def vector? @sample_values.any? do |sample_value| sample_value.is_a?(Array) end end |