Module: Kernel
- Defined in:
- lib/hobo_support/module.rb,
lib/hobo_support/kernel.rb,
lib/hobo_support/methodphitamine.rb
Overview
classy_module lets you extract code from classes into modules, but still write it the same way
Instance Method Summary collapse
Instance Method Details
#classy_module(mod = Module.new, &b) ⇒ Object
87 88 89 90 91 92 |
# File 'lib/hobo_support/module.rb', line 87 def classy_module(mod=Module.new, &b) mod. :included do |base| base.class_eval &b end mod end |
#dbg(*args) ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/hobo_support/kernel.rb', line 3 def dbg(*args) puts "---DEBUG---" args.each do |a| if a.is_a?(String) && a =~ /\n/ puts %("""\n) + a + %(\n"""\n) else p a end end puts "-----------" args.first end |
#it ⇒ Object Also known as: its
7 |
# File 'lib/hobo_support/methodphitamine.rb', line 7 def it() It.new end |