class AvroPinions::Configuration
Attributes
publisher[RW]
schema_registry[RW]
wire_format[RW]
Public Class Methods
new()
click to toggle source
# File lib/avro_pinions/configuration.rb, line 9 def initialize end
Public Instance Methods
publisher=(pub)
click to toggle source
# File lib/avro_pinions/configuration.rb, line 12 def publisher=(pub) unless pub.respond_to?(:publish) && pub.method(:publish).arity == 2 raise InvalidConfiguration.new("Please define a publisher that responds to publish and receives a topic and message") end @publisher = pub end
schema_registry=(options = {})
click to toggle source
:type gets pulled off and constructs the given registy all of the rest of the options get passed to an instance of hte type.kklk
# File lib/avro_pinions/configuration.rb, line 21 def schema_registry=(options = {}) klass = options.delete(:type).to_s.split(/_/).map(&:capitalize).join const = Object.const_get("AvroPinions::#{klass}Registry") sr = const.new(options) @schema_registry = sr end
wire_format=(format)
click to toggle source
# File lib/avro_pinions/configuration.rb, line 28 def wire_format=(format) unless AvroPinions::Codec::SUPPORTED_WIRE_FORMATS.include?(format) raise InvalidConfiguration.new("Please supply a valid wire format. Valid options are: #{AvroPinions::Codec::SUPPORTED_WIRE_FORMATS}") end @wire_format = format end