Class: Risu::Renderers::CSVRenderer
- Inherits:
-
Object
- Object
- Risu::Renderers::CSVRenderer
- Defined in:
- lib/risu/renderers/csvrenderer.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(output_file, &block) ⇒ CSVRenderer
constructor
A new instance of CSVRenderer.
- #text(text, *args) ⇒ Object
Constructor Details
#initialize(output_file, &block) ⇒ CSVRenderer
Returns a new instance of CSVRenderer.
35 36 37 38 |
# File 'lib/risu/renderers/csvrenderer.rb', line 35 def initialize output_file, &block @output_file = output_file instance_eval(&block) end |
Class Method Details
.generate(output_file, &block) ⇒ Object
28 29 30 31 |
# File 'lib/risu/renderers/csvrenderer.rb', line 28 def self.generate output_file, &block #csv = new(output_file, &block) return new(output_file, &block) end |
Instance Method Details
#text(text, *args) ⇒ Object
42 43 44 45 46 |
# File 'lib/risu/renderers/csvrenderer.rb', line 42 def text text, *args File.open(@output_file, "a+") do |file| file.write text + "\n" end end |