Class: FileMessage

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

Overview

FileMessage - simple class to write a message

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(message_name) ⇒ FileMessage

Returns a new instance of FileMessage.



4
5
6
# File 'lib/file_message.rb', line 4

def initialize(message_name)
  @message_name = message_name
end

Instance Attribute Details

#message_nameObject (readonly)

Returns the value of attribute message_name.



3
4
5
# File 'lib/file_message.rb', line 3

def message_name
  @message_name
end

Instance Method Details

#write_message(queue_location, message) ⇒ Object



8
9
10
11
12
# File 'lib/file_message.rb', line 8

def write_message(queue_location, message)
  File.open(queue_location + '/' + @message_name, 'w') do |file|
    file.puts message
  end
end