class Typist::DataFunc
A DataFunc
is Typist's equivalent of a class method.
Attributes
block[R]
name[R]
Public Class Methods
new(name, &block)
click to toggle source
Create a new DataFunc
.
# File lib/typist/data_func.rb, line 6 def initialize(name, &block) @name = name @block = block end
Public Instance Methods
define!(context)
click to toggle source
Define a DataFunc
in the given context.
# File lib/typist/data_func.rb, line 12 def define!(context) context.define_singleton_method(name, &block) end