Class: Ixtlan::Errors::Dumper
- Inherits:
-
Object
- Object
- Ixtlan::Errors::Dumper
- Includes:
- Slf4r::Logger
- Defined in:
- lib/ixtlan/errors/dumper.rb
Defined Under Namespace
Classes: Log
Instance Attribute Summary collapse
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#block ⇒ Object
Returns the value of attribute block.
-
#from_email ⇒ Object
Returns the value of attribute from_email.
-
#keep_dumps ⇒ Object
Returns the value of attribute keep_dumps.
-
#model ⇒ Object
Returns the value of attribute model.
-
#to_emails ⇒ Object
Returns the value of attribute to_emails.
Instance Method Summary collapse
- #dump(exception, request, response, session, params) ⇒ Object
-
#initialize(model = nil, &block) ⇒ Dumper
constructor
A new instance of Dumper.
Constructor Details
#initialize(model = nil, &block) ⇒ Dumper
Returns a new instance of Dumper.
50 51 52 53 54 55 |
# File 'lib/ixtlan/errors/dumper.rb', line 50 def initialize( model = nil, &block ) @model = model @keep_dumps = 0 block.call( self ) if block @block = block end |
Instance Attribute Details
#base_url ⇒ Object
Returns the value of attribute base_url.
48 49 50 |
# File 'lib/ixtlan/errors/dumper.rb', line 48 def base_url @base_url end |
#block ⇒ Object
Returns the value of attribute block.
48 49 50 |
# File 'lib/ixtlan/errors/dumper.rb', line 48 def block @block end |
#from_email ⇒ Object
Returns the value of attribute from_email.
48 49 50 |
# File 'lib/ixtlan/errors/dumper.rb', line 48 def from_email @from_email end |
#keep_dumps ⇒ Object
Returns the value of attribute keep_dumps.
48 49 50 |
# File 'lib/ixtlan/errors/dumper.rb', line 48 def keep_dumps @keep_dumps end |
#model ⇒ Object
Returns the value of attribute model.
48 49 50 |
# File 'lib/ixtlan/errors/dumper.rb', line 48 def model @model end |
#to_emails ⇒ Object
Returns the value of attribute to_emails.
48 49 50 |
# File 'lib/ixtlan/errors/dumper.rb', line 48 def to_emails @to_emails end |
Instance Method Details
#dump(exception, request, response, session, params) ⇒ Object
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 |
# File 'lib/ixtlan/errors/dumper.rb', line 67 def dump( exception, request, response, session , params ) update_config daily_cleanup error = dump_environment( exception, request, response, session, params ) if not error.id.nil? and not @to_emails.blank? and not @from_email.blank? Mailer.error_notification( @from_email, @to_emails, exception, "#{@base_url}/#{error.id}" ).deliver true else false end end |