Class: TaintedLove::Warning
- Inherits:
-
Object
- Object
- TaintedLove::Warning
- Defined in:
- lib/tainted_love/warning.rb
Instance Attribute Summary collapse
-
#message ⇒ Object
Returns the value of attribute message.
-
#replacer ⇒ Object
Returns the value of attribute replacer.
-
#reported_at ⇒ Object
Returns the value of attribute reported_at.
-
#stack_trace ⇒ Object
Returns the value of attribute stack_trace.
-
#tags ⇒ Object
Returns the value of attribute tags.
-
#tainted_input ⇒ Object
Returns the value of attribute tainted_input.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize ⇒ Warning
constructor
A new instance of Warning.
- #stack_trace_line ⇒ Object
- #to_json ⇒ Object
Constructor Details
#initialize ⇒ Warning
Returns a new instance of Warning.
7 8 9 |
# File 'lib/tainted_love/warning.rb', line 7 def initialize @reported_at = Time.now.to_i end |
Instance Attribute Details
#message ⇒ Object
Returns the value of attribute message.
5 6 7 |
# File 'lib/tainted_love/warning.rb', line 5 def @message end |
#replacer ⇒ Object
Returns the value of attribute replacer.
5 6 7 |
# File 'lib/tainted_love/warning.rb', line 5 def replacer @replacer end |
#reported_at ⇒ Object
Returns the value of attribute reported_at.
5 6 7 |
# File 'lib/tainted_love/warning.rb', line 5 def reported_at @reported_at end |
#stack_trace ⇒ Object
Returns the value of attribute stack_trace.
5 6 7 |
# File 'lib/tainted_love/warning.rb', line 5 def stack_trace @stack_trace end |
#tags ⇒ Object
Returns the value of attribute tags.
5 6 7 |
# File 'lib/tainted_love/warning.rb', line 5 def @tags end |
#tainted_input ⇒ Object
Returns the value of attribute tainted_input.
5 6 7 |
# File 'lib/tainted_love/warning.rb', line 5 def tainted_input @tainted_input end |
Instance Method Details
#==(other) ⇒ Object
11 12 13 |
# File 'lib/tainted_love/warning.rb', line 11 def ==(other) stack_trace == other.stack_trace && tainted_input == other.tainted_input end |
#stack_trace_line ⇒ Object
15 16 17 |
# File 'lib/tainted_love/warning.rb', line 15 def stack_trace_line @stack_trace.lines.first end |
#to_json ⇒ Object
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/tainted_love/warning.rb', line 19 def to_json { stack_trace: @stack_trace, replacer: @replacer, tainted_input: @tainted_input, reported_at: @reported_at, message: @message, tags: @tags, }.to_json end |