Top Level Namespace
Defined Under Namespace
Modules: Advisable, Archive, BBCode, BinReadable, Buildable, Cloneable, Comparable, Console, ConsoleUtils, Crypt, Enumerable, EnumerablePass, Expirable, Facets, FileTest, FileUtils, Fileable, Glue, Indexable, Instantise, Kernel, Lazy, Multiton, Registerable, Shellwords, Stackable, System, Uninheritable, UploadUtils, ZipUtils Classes: Array, As, Aspect, Association, Autoarray, BasicObject, Behavior, BiCrypt, BigDuration, Binding, BuildingBlock, Cache, Capsule, Class, Coroutine, Cut, Date, Dictionary, Dir, Downloader, Duration, EventHook, Exception, FalseClass, File, FileList, Float, Functor, GetoptLong, Hash, HashBuilder, IORedirect, InstanceReflection, Integer, Interval, Joinpoint, LRUCache, LinkedList, Logger, MatchData, Method, MissingArgument, Module, NackClass, NilClass, NullClass, Numeric, Object, ObjectReflection, ObjectSpace, OpenCascade, OpenCollection, OpenObject, OpenStruct, PQueue, PathList, Pathname, Pool, Proc, Prototype, RWDelegator, Range, Recorder, RecursiveDependency, Reference, Regexp, Semaphore, Settings, SimpleStringIO, Snapshot, String, Struct, Symbol, SyncArray, SyncHash, Target, Time, Timer, TrueClass, Tuple, TypeCastException, UnboundMethod, VersionNumber, VirtualShell, Weekdays
Constant Summary collapse
- Heap =
Heap is PQueue.
PQueue- Path =
Constant alias of Pathname (short is better!)
Pathname- Root =
Root constant for building paths from root directory onward.
Pathname.new('/')
- PromoteSelf =
Old name. To be deprecated.
Instantise- BinaryReader =
Compatability with old version.
BinReadable- OrderedHash =
OrderedHash
OrderedHash is an alias for the Dictionary class
Dictionary
Instance Method Summary collapse
-
#__ ⇒ Object
Convenience method for curry hold (ie. MissingArgument).
- #cross_cut(klass) ⇒ Object
-
#memoize(*args) ⇒ Object
This allows memoize to work in main and instance scope too.
Instance Method Details
#__ ⇒ Object
Convenience method for curry hold (ie. MissingArgument)
36 37 38 |
# File 'lib/more/facets/curry.rb', line 36 def __ MissingArgument end |
#cross_cut(klass) ⇒ Object
108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 |
# File 'lib/more/facets/aop.rb', line 108 def cross_cut(klass) Cut.new(klass) do define_method :__base__ do klass end all_instance_methods.each do |meth| undef_method(meth) unless meth.to_s =~ /(^__|initialize$|p$|class$|inspect$)/ end #def initialize(base, *args, &block) # @base = base # @delegate = base.__new(*args, &block) # @advices = {} #end def method_missing(sym, *args, &blk) # p "METHOD MISSING: #{sym}" #if DEBUG @advices ||= {} base = __base__ jp = Joinpoint.new(self, base, sym, *args, &blk) # calculate advices on first use. unless @advices[sym] @advices[sym] = [] base.aspects.each do |aspect| aspect.points.each do |advice, matches| matches.each do |match| if jp === match @advices[sym] << [aspect, advice] end end end end end target = jp #Target.new(self, sym, *args, &blk) # Target == JoinPoint ? @advices[sym].each do |(aspect, advice)| target = Target.new(aspect, advice, target) end target.super end end end |
#memoize(*args) ⇒ Object
This allows memoize to work in main and instance scope too. – Would this be good to have? Will need to modify for instance level, if so. ++
78 79 80 |
# File 'lib/more/facets/memoize.rb', line 78 def memoize(*args) Object.memoize(*args) end |