Top Level Namespace

Defined Under Namespace

Modules: English, Enumerable, Kernel, StrokeDB Classes: Array, BlankSlate, Class, FalseClass, Fixnum, Float, Hash, Module, NilClass, Numeric, Object, String, Symbol, TrueClass

Constant Summary collapse

InfiniteString =
Class.new(String) do
  def infinite?
    true
  end
end.new.freeze
InfiniteTime =
Class.new(Time) do
  def infinite?
    true
  end
end.new.freeze
LargestString =

Syntactic sugar: sweet aliases for daily use. For use like (SmallestString..“a”) in View#find()

SmallestString = StringInfinity = InfiniteString
LargestTime =
SmallestTime   = TimeInfinity = InfiniteTime

Instance Method Summary collapse

Instance Method Details

#BlankSlate(superclass = nil) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/strokedb/util/blankslate.rb', line 27

def BlankSlate superclass = nil
  if superclass
    (@blank_slates ||= {})[superclass] ||= Class.new(superclass) do
      instance_methods.sort.each { |m|
        unless m =~ /^__/
          mname = "__#{::BlankSlate::MethodMapping[m.to_s] || m}"
          class_eval "alias :'#{mname}' :'#{m}'" 
          
          undef_method m
        end
      }
    end
  else
    BlankSlate
  end
end