Class: Decisive::RenderContext

Inherits:
Struct
  • Object
show all
Defined in:
lib/decisive/template_handler.rb

Defined Under Namespace

Classes: Row

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#blockObject

Returns the value of attribute block

Returns:

  • (Object)

    the current value of block



148
149
150
# File 'lib/decisive/template_handler.rb', line 148

def block
  @block
end

#filenameObject

Returns the value of attribute filename

Returns:

  • (Object)

    the current value of filename



148
149
150
# File 'lib/decisive/template_handler.rb', line 148

def filename
  @filename
end

#recordsObject

Returns the value of attribute records

Returns:

  • (Object)

    the current value of records



148
149
150
# File 'lib/decisive/template_handler.rb', line 148

def records
  @records
end

Instance Method Details

#csv?Boolean

Returns:

  • (Boolean)


155
156
157
# File 'lib/decisive/template_handler.rb', line 155

def csv?
  true
end

#to_csv(*args, **kwargs) ⇒ Object



149
150
151
152
153
# File 'lib/decisive/template_handler.rb', line 149

def to_csv(*args, **kwargs)
  (header + body).map do |row|
    row.to_csv(*args, **kwargs)
  end.join
end