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.



1399
1400
1401
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1399

def initialize(element)
    @element = element
end

Class Method Details

.create_subclass(msg) ⇒ Object



1405
1406
1407
1408
1409
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1405

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

.msgObject



1413
1414
1415
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1413

def self.msg
    @msg
end

.msg=(msg) ⇒ Object



1410
1411
1412
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1410

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

Instance Method Details

#elementObject



1402
1403
1404
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1402

def element
    @element
end

#messageObject



1416
1417
1418
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1416

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

#to_sObject



1419
1420
1421
# File 'lib/spiderfw/model/mappers/mapper.rb', line 1419

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