class Decisive::RenderContext::Row

Public Instance Methods

to_hash() click to toggle source
# File lib/decisive/template_handler.rb, line 256
def to_hash
  @hash = {}
  instance_exec record, &block
  @hash
end

Private Instance Methods

column(key, value=Nothing, &block) click to toggle source
# File lib/decisive/template_handler.rb, line 264
def column key, value=Nothing, &block
  @hash[key] = if block_given?
    block.call(record)
  elsif value.is_a?(Symbol)
    record.send(value)
  elsif value == Nothing
    record.send(key.parameterize.underscore.to_sym)
  else
    value
  end.to_s
end