Class: Hopper::Message::Factory

Inherits:
Object
  • Object
show all
Defined in:
lib/hopper/message/factory.rb

Instance Method Summary collapse

Constructor Details

#initialize(encoder) ⇒ Factory

Returns a new instance of Factory.


4
5
6
# File 'lib/hopper/message/factory.rb', line 4

def initialize(encoder)
  @decoder_klass = encoder_klass
end

Instance Method Details

#build(payload) ⇒ Object


8
9
10
11
# File 'lib/hopper/message/factory.rb', line 8

def build(payload)
  message = Hopper::Message.new(payload, encoder)
  @decoder_klass.new(message)
end