Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/innate/metaid.rb,
lib/innate/scriptlines.rb,
lib/innate/tracerequire.rb
Overview
Constant Summary collapse
- @@__require_depth =
0
- @@__require_count =
0
Instance Method Summary collapse
-
#class_def(name, &blk) ⇒ Object
Defines an instance method within a class.
- #class_undef(name) ⇒ Object
-
#meta_def(name, &blk) ⇒ Object
Adds methods to a metaclass.
- #meta_eval(&blk) ⇒ Object
-
#metaclass ⇒ Object
The hidden singleton lurks behind everyone.
- #require(s) ⇒ Object
- #require_before_laziness ⇒ Object
- #require_before_tracerequire ⇒ Object
Instance Method Details
#class_def(name, &blk) ⇒ Object
Defines an instance method within a class
23 24 25 |
# File 'lib/innate/metaid.rb', line 23 def class_def name, &blk class_eval { define_method name, &blk } end |
#class_undef(name) ⇒ Object
27 28 29 |
# File 'lib/innate/metaid.rb', line 27 def class_undef name class_eval { undef_method name } end |
#meta_def(name, &blk) ⇒ Object
Adds methods to a metaclass
18 19 20 |
# File 'lib/innate/metaid.rb', line 18 def name, &blk { define_method name, &blk } end |
#meta_eval(&blk) ⇒ Object
13 14 15 |
# File 'lib/innate/metaid.rb', line 13 def &blk .instance_eval(&blk) end |
#metaclass ⇒ Object
The hidden singleton lurks behind everyone
7 8 9 10 11 |
# File 'lib/innate/metaid.rb', line 7 def class << self self end end |
#require(s) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/innate/scriptlines.rb', line 36 def require *files r = require_before_laziness(*files) if r files.each do |f| fn = find_in_path f if fn fl = FileLines.new fn SCRIPT_LINES__[fn] = fl SCRIPT_LINES__[f] = fl if f[0] == ?. end end ScriptLines.handle_odd_paths end return r end |
#require_before_laziness ⇒ Object
35 |
# File 'lib/innate/scriptlines.rb', line 35 alias :require_before_laziness :require |
#require_before_tracerequire ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/innate/tracerequire.rb', line 2 def require *files r = require_before_laziness(*files) if r files.each do |f| fn = find_in_path f if fn fl = FileLines.new fn SCRIPT_LINES__[fn] = fl SCRIPT_LINES__[f] = fl if f[0] == ?. end end ScriptLines.handle_odd_paths end return r end |