Sha256: 0cc060d6db2b265b47d6a8ea6b882aead5767a73beb70d0848fa8fd8ae601490
Contents?: true
Size: 585 Bytes
Versions: 12
Compression:
Stored size: 585 Bytes
Contents
module TableBuilder class Column attr_reader :name, :options def initialize(table, name, options = {}) @table = table @name = name @value = options.delete(:value) @options = options.dup || {} @options[:class] ||= name end def content name.is_a?(Symbol) ? translate(name) : name end def translate(content) scope = [TableBuilder.options[:i18n_scope], @table.collection_name, :columns].compact I18n.t(content, :scope => scope) end def attribute_name name.to_s.underscore end end end
Version data entries
12 entries across 12 versions & 2 rubygems