Sha256: dcfc07a0d9540768d1585d5b2b4f129a1bd22c394ed15b9fe27b331deac3996d
Contents?: true
Size: 685 Bytes
Versions: 55
Compression:
Stored size: 685 Bytes
Contents
# frozen_string_literal: true # In practice this is just a regular hash with the aggregate, format, search, sort do syntax that saves a block module Effective class DatatableColumn attr_accessor :attributes delegate :[], :[]=, to: :attributes def initialize(attributes) @attributes = attributes end def to_s self[:name] end def aggregate(&block) @attributes[:aggregate] = block; self end def format(&block) @attributes[:format] = block; self end def search(&block) @attributes[:search_method] = block; self end def sort(&block) @attributes[:sort_method] = block; self end end end
Version data entries
55 entries across 55 versions & 1 rubygems