Class: RandomConverter

Inherits:
Converter show all
Includes:
Logging
Defined in:
lib/business/converter/random_converter.rb

Overview

Self implementation from the Converter to work it with the Random Phrase Generator

Author:

  • Daniel Machado Fernandez

Version:

  • 1.0

Constant Summary

Constants included from Logging

Logging::KermitPFC

Instance Method Summary collapse

Methods included from Logging

#logger, logger

Instance Method Details

#to_usmf(status) ⇒ USMF

Returns the resultant message.

Parameters:

  • status (String)

    the phrase from the Random Phrase Generator

Returns:

  • (USMF)

    the resultant message



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/business/converter/random_converter.rb', line 20

def to_usmf status

	usmf = USMF.new
	user = User.new

	x = status.split('@')

	usmf.service = 'Random' 
     	usmf.id = x[0]
     	usmf.text = x[2]
     	user.name = x[1]

     	usmf.user = user

     	usmf.links = []
     	usmf.to_users = []
           
	usmf
	
end