Class: Pheromone::Messaging::MessageFormatter
- Inherits:
-
Object
- Object
- Pheromone::Messaging::MessageFormatter
- Defined in:
- lib/pheromone/messaging/message_formatter.rb
Constant Summary collapse
- SUPPORTED_MESSAGE_FORMATS =
[:json].freeze
Instance Method Summary collapse
- #format ⇒ Object
-
#initialize(message) ⇒ MessageFormatter
constructor
A new instance of MessageFormatter.
Constructor Details
#initialize(message) ⇒ MessageFormatter
Returns a new instance of MessageFormatter.
7 8 9 |
# File 'lib/pheromone/messaging/message_formatter.rb', line 7 def initialize() @message = end |
Instance Method Details
#format ⇒ Object
11 12 13 14 15 16 17 |
# File 'lib/pheromone/messaging/message_formatter.rb', line 11 def format if Pheromone.config. == :json convert_to_time_format.to_json elsif !SUPPORTED_MESSAGE_FORMATS.include?(Pheromone.config.) raise Pheromone::Exceptions::UnsupportedMessageFormat.new end end |