Sha256: 1cffbcb2b2dbb68a1caf65beda9cd25ea258dfa42ff0624257d1a67f15644aa2
Contents?: true
Size: 476 Bytes
Versions: 8
Compression:
Stored size: 476 Bytes
Contents
require 'rubygems' require 'narray' require 'facets' module NArrayExtensions def pretty_string(opts={}) { :col_header => nil, :row_header => nil }.merge!(opts) ("%-3s" % "#") + opts[:col_header].inject("") { |s, a| s + ("%7s" % a) } + "\n" + self.to_a.inject("%-3s" % opts[:row_header]) { |s, v| if v.is_a? Float s + ("%7.2f" % v) else s + ("%7d" % v) end } end end NArray.send(:include, NArrayExtensions)
Version data entries
8 entries across 8 versions & 2 rubygems