Exception: MakeEntryError

Inherits:
JoinFixError show all
Defined in:
lib/joinfix/error.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Attributes inherited from JoinFixError

#entry_name, #fixtures, #msg

Instance Method Summary collapse

Methods inherited from JoinFixError

new

Constructor Details

#initialize(fixtures, entry_name, entry, msg = nil) ⇒ MakeEntryError

Returns a new instance of MakeEntryError.



49
50
51
52
# File 'lib/joinfix/error.rb', line 49

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

Instance Attribute Details

#adviceObject

Returns the value of attribute advice.



47
48
49
# File 'lib/joinfix/error.rb', line 47

def advice
  @advice
end

#entryObject (readonly)

Returns the value of attribute entry.



46
47
48
# File 'lib/joinfix/error.rb', line 46

def entry
  @entry
end

Instance Method Details

#messageObject



54
55
56
57
58
59
# File 'lib/joinfix/error.rb', line 54

def message
	"Error making <#{fixtures.klass.table_name}(:#{entry_name})> in <#{fixtures.fixture_path}>.\n" + 
	{entry_name => entry}.to_yaml +
	(msg.nil? ? '' : "\n#{msg}\n") +
	(advice.nil? ? '' : "#{advice}\n")
end