class Scruffy::Formatters::Custom

Allows you to pass in a Proc for use as a formatter.

Use:

graph.value_formatter = ::new { |value, idx, options| "Displays Returned Value" }

Attributes

proc[R]

Public Class Methods

new(&block) click to toggle source
# File lib/scruffy/formatters.rb, line 57
def initialize(&block)
  @proc = block
end

Public Instance Methods

format(target, idx, options) click to toggle source
# File lib/scruffy/formatters.rb, line 61
def format(target, idx, options)
  proc.call(target, idx, options)
end