Class: Object

Inherits:
BasicObject
Defined in:
lib/has_many_polymorphs/support_methods.rb,
lib/has_many_polymorphs/rake_task_redefine_task.rb

Instance Method Summary collapse

Instance Method Details

#_logger_debug(s) ⇒ Object

Logger shortcut.



60
61
62
63
# File 'lib/has_many_polymorphs/support_methods.rb', line 60

def _logger_debug s
  s = "** has_many_polymorphs: #{s}"
  RAILS_DEFAULT_LOGGER.debug(s) if RAILS_DEFAULT_LOGGER
end

#_logger_warn(s) ⇒ Object

Logger shortcut.



66
67
68
69
70
71
72
73
# File 'lib/has_many_polymorphs/support_methods.rb', line 66

def _logger_warn s
  s = "** has_many_polymorphs: #{s}"
  if RAILS_DEFAULT_LOGGER
    RAILS_DEFAULT_LOGGER.warn(s) 
  else
    $stderr.puts(s)
  end    
end

#_metaclassObject

Returns the metaclass of self.



57
# File 'lib/has_many_polymorphs/support_methods.rb', line 57

def _metaclass; (class << self; self; end); end

#silentlyObject



30
31
32
33
34
# File 'lib/has_many_polymorphs/rake_task_redefine_task.rb', line 30

def silently
  stderr, stdout, $stderr, $stdout = $stderr, $stdout, StringIO.new, StringIO.new
  yield
  $stderr, $stdout = stderr, stdout
end