Class: Umbra::Encoder

Inherits:
Object
  • Object
show all
Defined in:
lib/umbra/encoder.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(env) ⇒ Encoder

Returns a new instance of Encoder.



9
10
11
# File 'lib/umbra/encoder.rb', line 9

def initialize(env)
  @env = env
end

Class Method Details

.call(env) ⇒ Object



5
6
7
# File 'lib/umbra/encoder.rb', line 5

def self.call(env)
  new(env).call
end

Instance Method Details

#callObject



13
14
15
16
17
18
19
20
# File 'lib/umbra/encoder.rb', line 13

def call
  @call ||= Pb::Message.new(
    method: rack_request.request_method,
    url: rack_request.url,
    body: request_body,
    headers: request_headers
  ).to_proto
end

#ignored_headersObject



22
23
24
# File 'lib/umbra/encoder.rb', line 22

def ignored_headers
  []
end