Module: SwitchmanInstJobs::PsychExt::ToRuby

Defined in:
lib/switchman_inst_jobs/yaml_extensions.rb

Instance Method Summary collapse

Instance Method Details

#visit_Psych_Nodes_Scalar(object) ⇒ Object

rubocop:disable Naming/MethodName


4
5
6
7
8
9
10
11
12
# File 'lib/switchman_inst_jobs/yaml_extensions.rb', line 4

def visit_Psych_Nodes_Scalar(object) # rubocop:disable Naming/MethodName
  if object.tag == '!ruby/ActiveRecord:Switchman::Shard'
    ::Switchman::Shard.lookup(object.value) ||
      raise(Delayed::Backend::RecordNotFound,
            "Couldn't find Switchman::Shard with id #{object.value.inspect}")
  else
    super
  end
end