Class: Mess::Plotter
- Inherits:
-
Object
- Object
- Mess::Plotter
- Defined in:
- lib/mess/plotter.rb
Direct Known Subclasses
Constant Summary collapse
- @@available =
stores all available plotters
Hash.new
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Class Method Summary collapse
-
.available ⇒ Object
lists all available plotters.
-
.describe(desc) ⇒ Object
needs to be described in order to be “centrally” available adds plotter class to available plotters with custom description name is derived from plotter class name.
Instance Method Summary collapse
-
#initialize(chat) ⇒ Plotter
constructor
A new instance of Plotter.
-
#run ⇒ Object
should return Mess::Plot.
Constructor Details
#initialize(chat) ⇒ Plotter
Returns a new instance of Plotter.
30 31 32 |
# File 'lib/mess/plotter.rb', line 30 def initialize chat @chat = chat end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
20 21 22 |
# File 'lib/mess/plotter.rb', line 20 def data @data end |
Class Method Details
.available ⇒ Object
lists all available plotters
16 17 18 |
# File 'lib/mess/plotter.rb', line 16 def self.available @@available end |
.describe(desc) ⇒ Object
needs to be described in order to be “centrally” available adds plotter class to available plotters with custom description name is derived from plotter class name
25 26 27 28 |
# File 'lib/mess/plotter.rb', line 25 def self.describe desc name = self.to_s.match(/Mess::(?<name>\w+)$/)[:name] @@available[name] = desc end |
Instance Method Details
#run ⇒ Object
should return Mess::Plot
35 36 37 38 39 |
# File 'lib/mess/plotter.rb', line 35 def run @chat.msgs.each { |msg| push(msg) } finalize generate_plot end |