Exception: Spider::Model::MapperElementError

Inherits:
MapperError show all
Defined in:
lib/spiderfw/model/mappers/mapper.rb

Overview

Generic Mapper error regarding an element.

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(element) ⇒ MapperElementError

Returns a new instance of MapperElementError.



1131
1132
1133
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1131

def initialize(element)
    @element = element
end

Class Method Details

.create_subclass(msg) ⇒ Object



1137
1138
1139
1140
1141
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1137

def self.create_subclass(msg)
    e = Class.new(self)
    e.msg = msg
    return e
end

.msgObject



1145
1146
1147
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1145

def self.msg
    @msg
end

.msg=(msg) ⇒ Object



1142
1143
1144
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1142

def self.msg=(msg)
    @msg = msg
end

Instance Method Details

#elementObject



1134
1135
1136
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1134

def element
    @element
end

#messageObject



1148
1149
1150
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1148

def message
    _(self.class.msg) % @element.label
end

#to_sObject



1151
1152
1153
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1151

def to_s
    self.class.name.to_s + " " + message
end