Sha256: 67fbe7567719e64fc8c9a271f151863be267bca3b754fbd3f4eab6b624f397ec
Contents?: true
Size: 668 Bytes
Versions: 2
Compression:
Stored size: 668 Bytes
Contents
# frozen_string_literal: true require_relative "base" module Katalyst module Tables module Frontend module Builder class BodyCell < Base # :nodoc: attr_reader :object, :method def initialize(table, object, method, **options) super table, **options @type = options.fetch(:heading, false) ? :th : :td @object = object @method = method end def build table_tag(@type) { block_given? ? yield(self).to_s : value.to_s } end def value object.public_send(method) end end end end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
katalyst-tables-1.1.0 | lib/katalyst/tables/frontend/builder/body_cell.rb |
katalyst-tables-1.0.0 | lib/katalyst/tables/frontend/builder/body_cell.rb |