Class: Object
- Inherits:
- BasicObject
- Defined in:
- lib/core_ext/object.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.const_belongs_to_parent?(sym) ⇒ Boolean
21 22 23 24 25 26 27 28 29 |
# File 'lib/core_ext/object.rb', line 21 def self.const_belongs_to_parent?(sym) ( self.superclass && self.superclass.const_defined?(sym) && ( self.superclass.const_get(sym) == self.const_get(sym) ) ) end |
.force_print_trace(msg = "CALLED TRACER METHOD") ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/core_ext/object.rb', line 3 def self.force_print_trace(msg = "CALLED TRACER METHOD") begin raise rescue puts "" puts "" puts "----------------" puts msg puts "" puts $!.backtrace puts "" puts "" puts "----------------" puts "" puts "" end end |
Instance Method Details
#force_print_trace(msg = "CALLED TRACER METHOD") ⇒ Object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/core_ext/object.rb', line 31 def force_print_trace(msg = "CALLED TRACER METHOD") begin raise rescue puts "" puts "" puts "----------------" puts msg puts "" puts $!.backtrace puts "" puts "" puts "----------------" puts "" puts "" end end |
#yes_no_to_s ⇒ Object
49 50 51 |
# File 'lib/core_ext/object.rb', line 49 def yes_no_to_s !!self == self ? (self ? 'yes' : 'no') : to_s end |