Sha256: fa29369f812570bde7afd3a1ac17efdd155027c2940e028e22e5288d537c638b
Contents?: true
Size: 447 Bytes
Versions: 9
Compression:
Stored size: 447 Bytes
Contents
module TableHelp class Strategy attr_reader :name, :symbol_or_proc def initialize(name, symbol_or_proc) @name = name @symbol_or_proc = symbol_or_proc end def to_value(record, context = nil) case symbol_or_proc when Symbol, String record.send(symbol_or_proc) when Proc context.capture { symbol_or_proc.call(record) } else record.send(name) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems