Class: AmqpUtils::MessageFormatter

Inherits:
Object
  • Object
show all
Defined in:
lib/amqp_utils/message_formatter.rb

Defined Under Namespace

Classes: Base, JSON, Message, Pretty

Class Method Summary collapse

Class Method Details

.for_type(format_type) ⇒ Object



5
6
7
8
# File 'lib/amqp_utils/message_formatter.rb', line 5

def for_type(format_type)
  klass = @@formatters[format_type.downcase]
  klass && klass.new
end

.register_formatter(formatter, format_type) ⇒ Object



14
15
16
# File 'lib/amqp_utils/message_formatter.rb', line 14

def register_formatter(formatter, format_type)
  @@formatters[format_type.downcase] = formatter
end

.typesObject



10
11
12
# File 'lib/amqp_utils/message_formatter.rb', line 10

def types
  @@formatters.keys
end