Class: Assert::Suite::ContextInfo
- Inherits:
-
Object
- Object
- Assert::Suite::ContextInfo
- Defined in:
- lib/assert/suite.rb
Instance Attribute Summary collapse
-
#called_from ⇒ Object
readonly
Returns the value of attribute called_from.
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#first_caller ⇒ Object
readonly
Returns the value of attribute first_caller.
-
#klass ⇒ Object
readonly
Returns the value of attribute klass.
Instance Method Summary collapse
-
#initialize(klass, called_from = nil, first_caller = nil) ⇒ ContextInfo
constructor
A new instance of ContextInfo.
Constructor Details
#initialize(klass, called_from = nil, first_caller = nil) ⇒ ContextInfo
Returns a new instance of ContextInfo.
10 11 12 13 14 15 16 17 |
# File 'lib/assert/suite.rb', line 10 def initialize(klass, called_from=nil, first_caller=nil) @first_caller = first_caller @called_from = called_from @klass = klass @file = if (@called_from || @first_caller) (@called_from || @first_caller).gsub(/\:[0-9]+.*$/, '') end end |
Instance Attribute Details
#called_from ⇒ Object (readonly)
Returns the value of attribute called_from.
8 9 10 |
# File 'lib/assert/suite.rb', line 8 def called_from @called_from end |
#file ⇒ Object (readonly)
Returns the value of attribute file.
8 9 10 |
# File 'lib/assert/suite.rb', line 8 def file @file end |
#first_caller ⇒ Object (readonly)
Returns the value of attribute first_caller.
8 9 10 |
# File 'lib/assert/suite.rb', line 8 def first_caller @first_caller end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass.
8 9 10 |
# File 'lib/assert/suite.rb', line 8 def klass @klass end |