Sha256: 00d4f0b2438df5906a37bf2e16bc88e3c45ee96e57eb5c2e9cb17fa6fabe54c1
Contents?: true
Size: 615 Bytes
Versions: 25
Compression:
Stored size: 615 Bytes
Contents
module MetricFu class Record attr_reader :data def initialize(data, columns) @data = data @columns = columns end def method_missing(name, *args, &block) key = name.to_s if @data.has_key?(key) @data[key] elsif @columns.member?(key) nil else super(name, *args, &block) end end def []=(key, value) @data[key]=value end def [](key) @data[key] end def keys @data.keys end def has_key?(key) @data.has_key?(key) end def attributes @columns end end end
Version data entries
25 entries across 25 versions & 2 rubygems