Class: ArrowFlight::CallOptions

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.try_convert(value) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/arrow-flight/call-options.rb', line 21

def try_convert(value)
  case value
  when Hash
    options = new
    value.each do |name, value|
      options.__send__("#{name}=", value)
    end
    options
  else
    nil
  end
end

Instance Method Details

#each_headerObject



42
43
44
45
46
47
# File 'lib/arrow-flight/call-options.rb', line 42

def each_header
  return to_enum(__method__) unless block_given?
  foreach_header do |key, value|
    yield(key, value)
  end
end

#headersObject



49
50
51
# File 'lib/arrow-flight/call-options.rb', line 49

def headers
  each_header.to_a
end

#headers=(headers) ⇒ Object



35
36
37
38
39
40
# File 'lib/arrow-flight/call-options.rb', line 35

def headers=(headers)
  clear_headers
  headers.each do |name, value|
    add_header(name, value)
  end
end