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.
-
#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.
135 136 137 138 139 |
# File 'lib/assert/suite.rb', line 135 def initialize(klass, called_from=nil, first_caller=nil) @called_from = called_from || first_caller @klass = klass @file = @called_from.gsub(/\:[0-9]+.*$/, '') if @called_from end |
Instance Attribute Details
#called_from ⇒ Object (readonly)
Returns the value of attribute called_from
133 134 135 |
# File 'lib/assert/suite.rb', line 133 def called_from @called_from end |
#file ⇒ Object (readonly)
Returns the value of attribute file
133 134 135 |
# File 'lib/assert/suite.rb', line 133 def file @file end |
#klass ⇒ Object (readonly)
Returns the value of attribute klass
133 134 135 |
# File 'lib/assert/suite.rb', line 133 def klass @klass end |