Class: View::Size

Inherits:
Formatter show all
Defined in:
lib/view/formatters/size.rb

Overview

Formats with number_to_human_size

Examples:


= view 1999, :as => :size # => "1.95 KB"

See Also:

Instance Attribute Summary

Attributes inherited from Formatter

#block, #template, #value

Instance Method Summary collapse

Methods inherited from Formatter

#all_options, as, #format!, inherited, #options, skip_blank_formatter, #to_s, type

Instance Method Details

#formatObject



14
15
16
# File 'lib/view/formatters/size.rb', line 14

def format
  template.number_to_human_size(value, options)
end