Module: Taskinator::Persistence::UnknownType

Defined in:
lib/taskinator/persistence.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#typeObject (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

#allocateObject



479
480
481
# File 'lib/taskinator/persistence.rb', line 479

def allocate
  self
end

#perform(*_) ⇒ Object

for unknown job types

Raises:



488
489
490
# File 'lib/taskinator/persistence.rb', line 488

def perform(*_)
  raise UnknownTypeError.new(to_s)
end

#to_sObject



475
476
477
# File 'lib/taskinator/persistence.rb', line 475

def to_s
  "Unknown type '#{type}'."
end