Module: Taskinator::Persistence::UnknownType
- Defined in:
- lib/taskinator/persistence.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Class Method Summary collapse
Instance Method Summary collapse
- #accept(*_) ⇒ Object
- #allocate ⇒ Object
-
#perform(*_) ⇒ Object
for unknown job types.
- #to_s ⇒ Object
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
473 474 475 |
# File 'lib/taskinator/persistence.rb', line 473 def type @type end |
Class Method Details
.new(type) ⇒ Object
460 461 462 463 464 465 466 467 468 469 470 471 |
# File 'lib/taskinator/persistence.rb', line 460 def self.new(type) Taskinator.logger.error("Unknown type '#{type}' while deserializing.") @unknown_types[type] ||= Module.new do extend UnknownType @type = type # for unknown definitions def method_missing(_, *_) raise UnknownTypeError.new(to_s) end end end |
Instance Method Details
#accept(*_) ⇒ Object
483 484 485 |
# File 'lib/taskinator/persistence.rb', line 483 def accept(*_) # nothing doing end |
#allocate ⇒ Object
479 480 481 |
# File 'lib/taskinator/persistence.rb', line 479 def allocate self end |
#perform(*_) ⇒ Object
for unknown job types
488 489 490 |
# File 'lib/taskinator/persistence.rb', line 488 def perform(*_) raise UnknownTypeError.new(to_s) end |
#to_s ⇒ Object
475 476 477 |
# File 'lib/taskinator/persistence.rb', line 475 def to_s "Unknown type '#{type}'." end |