Class: Sunsap::Reporter
- Inherits:
-
Object
- Object
- Sunsap::Reporter
- Defined in:
- lib/sunsap.rb
Overview
The reporter
Instance Method Summary collapse
-
#initialize(reportername) ⇒ Reporter
constructor
Create a new reporter.
-
#queue ⇒ Object
View the queue.
Constructor Details
#initialize(reportername) ⇒ Reporter
Create a new reporter
@api public
@param [reportername] the name of the reporter as a string
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/sunsap.rb', line 18 def initialize(reportername) @queue = [] # Send a message to the queue # # @api public # @param [m] message to send # # @example Send a message # # reporter.send_test_message "Success!" # # => true # # @returns true self.class.send :define_method, "send_#{reportername}_message" do |m| @queue.push(m) true end # View the queue # # @api public # @example Read a queue # # reporter.queue # # => ["Success!"] # # @returns Array of messages def queue @queue end true end |
Instance Method Details
#queue ⇒ Object
View the queue
46 47 48 |
# File 'lib/sunsap.rb', line 46 def queue @queue end |