Exception: JoinFixError

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/joinfix/error.rb

Overview

JoinFix provides help for debugging errors in your fixtures through subclasses of JoinFixError.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fixtures, entry_name, msg = nil) ⇒ JoinFixError

Returns a new instance of JoinFixError.



16
17
18
19
20
# File 'lib/joinfix/error.rb', line 16

def initialize(fixtures, entry_name, msg=nil)
	@fixtures = fixtures
	@entry_name = entry_name
   @msg = msg
end

Instance Attribute Details

#adviceObject

Returns the value of attribute advice.



14
15
16
# File 'lib/joinfix/error.rb', line 14

def advice
  @advice
end

#entry_nameObject (readonly)

Returns the value of attribute entry_name.



13
14
15
# File 'lib/joinfix/error.rb', line 13

def entry_name
  @entry_name
end

#fixturesObject (readonly)

Returns the value of attribute fixtures.



13
14
15
# File 'lib/joinfix/error.rb', line 13

def fixtures
  @fixtures
end

#msgObject (readonly)

Returns the value of attribute msg.



13
14
15
# File 'lib/joinfix/error.rb', line 13

def msg
  @msg
end

Class Method Details

.new(*args) ⇒ Object



4
5
6
7
8
9
10
# File 'lib/joinfix/error.rb', line 4

def new(*args)
  @already_created ||= {}
  
  error = super(*args)
  key = error.fixtures.respond_to?(:fixture_path) ? error.fixtures.fixture_path : error.fixtures
  @already_created[key] ||= error
end