Class: Solace::Serializers::Base
- Inherits:
-
Object
- Object
- Solace::Serializers::Base
- Includes:
- Utils
- Defined in:
- lib/solace/serializers/base.rb
Direct Known Subclasses
Class Method Summary collapse
-
.call(*args, **kwargs) ⇒ String
Proxy method to call the serializer and create a new instance.
Instance Method Summary collapse
-
#call ⇒ String
Serializes the record.
Class Method Details
.call(*args, **kwargs) ⇒ String
Proxy method to call the serializer and create a new instance
11 12 13 |
# File 'lib/solace/serializers/base.rb', line 11 def self.call(*args, **kwargs) new(*args, **kwargs).call end |
Instance Method Details
#call ⇒ String
Serializes the record
18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/solace/serializers/base.rb', line 18 def call bin = self.class::STEPS .map { |m| send(m) } .flatten .compact .pack('C*') Base64.strict_encode64(bin) rescue NameError => e raise "STEPS must be defined: #{e.message}" end |