Sha256: 2c6ce2ddd6eeeae2e07c12e303c170e21e9043c4ca08e4847f0a13339d2b88bc

Contents?: true

Size: 216 Bytes

Versions: 8

Compression:

Stored size: 216 Bytes

Contents

module SuperFormatter
  Row = Struct.new(:data, :indexes) do
    def method_missing(m)
      find(m)
    end

    protected

    def find(m)
      i = indexes[m.to_sym]
      i.nil? ? nil : data[i]
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
super_tools-0.0.8 lib/super_formatter/row.rb
super_tools-0.0.7 lib/super_formatter/row.rb
super_tools-0.0.6 lib/super_formatter/row.rb
super_tools-0.0.5 lib/super_formatter/row.rb
super_tools-0.0.4 lib/super_formatter/row.rb
super_tools-0.0.3 lib/super_formatter/row.rb
super_tools-0.0.2 lib/super_formatter/row.rb
super_tools-0.0.1 lib/super_formatter/row.rb