Exception: Mappum::MappumException

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/mappum/mappum_exception.rb

Direct Known Subclasses

MapMissingException

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(mess = nil) ⇒ MappumException

Returns a new instance of MappumException.



5
6
7
8
9
10
11
# File 'lib/mappum/mappum_exception.rb', line 5

def initialize(mess=nil)
  super(mess)
  if mess.kind_of? Exception
    @caused_by = mess 
    set_backtrace(mess.backtrace)
  end
end

Instance Attribute Details

#caused_byObject

Returns the value of attribute caused_by.



3
4
5
# File 'lib/mappum/mappum_exception.rb', line 3

def caused_by
  @caused_by
end

#fromObject

Returns the value of attribute from.



3
4
5
# File 'lib/mappum/mappum_exception.rb', line 3

def from
  @from
end

#from_nameObject

Returns the value of attribute from_name.



3
4
5
# File 'lib/mappum/mappum_exception.rb', line 3

def from_name
  @from_name
end

#from_rootObject

Returns the value of attribute from_root.



3
4
5
# File 'lib/mappum/mappum_exception.rb', line 3

def from_root
  @from_root
end

#mappum_backtraceObject

Returns the value of attribute mappum_backtrace.



3
4
5
# File 'lib/mappum/mappum_exception.rb', line 3

def mappum_backtrace
  @mappum_backtrace
end

#toObject

Returns the value of attribute to.



3
4
5
# File 'lib/mappum/mappum_exception.rb', line 3

def to
  @to
end

#to_nameObject

Returns the value of attribute to_name.



3
4
5
# File 'lib/mappum/mappum_exception.rb', line 3

def to_name
  @to_name
end

#to_rootObject

Returns the value of attribute to_root.



3
4
5
# File 'lib/mappum/mappum_exception.rb', line 3

def to_root
  @to_root
end

Instance Method Details

#wrap(map, from, to) ⇒ Object



12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/mappum/mappum_exception.rb', line 12

def wrap(map, from, to)
   
   if map != nil and map != @map #don't store same maps twice
     @map = map 
     from_suffix, to_suffix = "",""
     
		  add_to_mappum_backtrace(map)
		  from_suffix = "[]" if map.from.array?
		  add_from_name(map.from.name, from_suffix)
		  to_suffix = "[]" if map.to.array?
		  add_to_name(map.to.name, to_suffix)
end
		@to = to if @to.nil?
		@from = from if @from.nil?
		@to_root = to
		@from_root = from 
       
end