Methods

Class/Module Index [+]

Quicksearch

Scruffy::Formatters::Custom

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

Use:

graph.value_formatter = Scruffy::Formatters::Custom.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

[Validate]

Generated with the Darkfish Rdoc Generator 2.