Class: ArrowFlight::ServerOptions

Inherits:
Object
  • Object
show all
Defined in:
lib/arrow-flight/server-options.rb

Class Method Summary collapse

Class Method Details

.try_convert(value) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# File 'lib/arrow-flight/server-options.rb', line 21

def try_convert(value)
  case value
  when Location
    new(value)
  when Hash
    return nil unless value.key?(:location)
    options = new(value[:location])
    value.each do |name, value|
      next if name == :location
      options.__send__("#{name}=", value)
    end
    options
  else
    value = Location.try_convert(value)
    return nil if value.nil?
    try_convert(value)
  end
end