Class: Assert::Suite::ContextInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/assert/suite.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_fromObject (readonly)

Returns the value of attribute called_from.



8
9
10
# File 'lib/assert/suite.rb', line 8

def called_from
  @called_from
end

#fileObject (readonly)

Returns the value of attribute file.



8
9
10
# File 'lib/assert/suite.rb', line 8

def file
  @file
end

#first_callerObject (readonly)

Returns the value of attribute first_caller.



8
9
10
# File 'lib/assert/suite.rb', line 8

def first_caller
  @first_caller
end

#klassObject (readonly)

Returns the value of attribute klass.



8
9
10
# File 'lib/assert/suite.rb', line 8

def klass
  @klass
end