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

Version Path
metric_fu-4.4.0 lib/metric_fu/metrics/hotspots/analysis/record.rb
metric_fu-4.3.1 lib/metric_fu/metrics/hotspots/analysis/record.rb
metric_fu-4.3.0 lib/metric_fu/metrics/hotspots/analysis/record.rb
metric_fu-4.2.1 lib/metric_fu/metrics/hotspots/analysis/record.rb
metric_fu-4.2.0 lib/metric_fu/metrics/hotspots/analysis/record.rb
metric_fu-4.1.3 lib/metric_fu/metrics/hotspots/analysis/record.rb
metric_fu-4.1.2 lib/metric_fu/metrics/hotspots/analysis/record.rb
metric_fu-4.1.1 lib/metric_fu/metrics/hotspots/analysis/record.rb
metric_fu-4.1.0 lib/metric_fu/metrics/hotspots/analysis/record.rb
metric_fu-4.0.0 lib/metric_fu/metrics/hotspots/analysis/record.rb
metric_fu-3.0.1 lib/metric_fu/metrics/hotspots/analysis/record.rb
metric_fu-3.0.0 lib/metric_fu/metrics/hotspots/analysis/record.rb
metric_fu-2.1.4.pre5 lib/metric_fu/metrics/hotspots/analysis/record.rb
metric_fu-2.1.4.pre4 lib/metric_fu/metrics/hotspots/analysis/record.rb
metric_fu-2.1.4.pre2 lib/metric_fu/metrics/hotspots/analysis/record.rb
metric_fu-2.1.4.pre lib/metric_fu/metrics/hotspots/analysis/record.rb
metric_fu-2.1.3.7.18.1 lib/metrics/hotspots/analysis/record.rb
metric_fu-2.1.3.7.19 lib/metrics/hotspots/analysis/record.rb
metric_fu-2.1.3.6 lib/metrics/hotspots/analysis/record.rb
metric_fu-2.1.3.5 lib/data_structures/record.rb