Class: Decisive::RenderCSVContext
- Inherits:
-
Struct
- Object
- Struct
- Decisive::RenderCSVContext
- Defined in:
- lib/decisive/render_csv_context.rb
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#filename ⇒ Object
Returns the value of attribute filename.
-
#records ⇒ Object
Returns the value of attribute records.
Instance Method Summary collapse
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block
6 7 8 |
# File 'lib/decisive/render_csv_context.rb', line 6 def block @block end |
#filename ⇒ Object
Returns the value of attribute filename
6 7 8 |
# File 'lib/decisive/render_csv_context.rb', line 6 def filename @filename end |
#records ⇒ Object
Returns the value of attribute records
6 7 8 |
# File 'lib/decisive/render_csv_context.rb', line 6 def records @records end |
Instance Method Details
#csv? ⇒ Boolean
13 14 15 |
# File 'lib/decisive/render_csv_context.rb', line 13 def csv? true end |
#to_csv(*args, **kwargs) ⇒ Object
7 8 9 10 11 |
# File 'lib/decisive/render_csv_context.rb', line 7 def to_csv(*args, **kwargs) Renderer.new(records, block).map do |row| row.to_csv(*args, **kwargs) end.join end |