Class: Faymora::Client

Inherits:
GlooX::Client
  • Object
show all
Defined in:
lib/faymora/client.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



5
6
7
8
# File 'lib/faymora/client.rb', line 5

def initialize( options = {} )
    options = options.symbolize_keys
    super( options.merge serializer: ::MessagePack )
end

Class Method Details

.from_data(data) ⇒ Object



20
21
22
# File 'lib/faymora/client.rb', line 20

def self.from_data( data )
    new( data.symbolize_keys )
end

Instance Method Details

#to_dataObject



14
15
16
17
18
# File 'lib/faymora/client.rb', line 14

def to_data
    data = @opts.dup
    data.delete :serializer
    data
end

#to_msgpack(packer) ⇒ Object



10
11
12
# File 'lib/faymora/client.rb', line 10

def to_msgpack( packer )
    packer.pack to_data
end