Sha256: e2b40dfa20a3d952322191972fc9f8949f54b52f89b7fdc31ce0f53d692aa123
Contents?: true
Size: 480 Bytes
Versions: 11
Compression:
Stored size: 480 Bytes
Contents
module NyanCatFormat module Wide def example_width(example = current) net_width_for(example) - net_width_for(example - 1) end def net_width_for(example) @net_width ||= {} @net_width[example] ||= begin return 0 if example < 0 net_width = terminal_width - padding_width - cat_length rough_example_width = (net_width * example.to_f / @example_count.to_f) rough_example_width.round end end end end
Version data entries
11 entries across 11 versions & 2 rubygems