Module: Delayed::JobGroups::YamlLoader

Defined in:
lib/delayed/job_groups/yaml_loader.rb

Class Method Summary collapse

Class Method Details

.dump(object) ⇒ Object



12
13
14
15
16
# File 'lib/delayed/job_groups/yaml_loader.rb', line 12

def self.dump(object)
  return if object.nil?

  YAML.dump(object)
end

.load(yaml) ⇒ Object



6
7
8
9
10
# File 'lib/delayed/job_groups/yaml_loader.rb', line 6

def self.load(yaml)
  return yaml unless yaml.is_a?(String) && /^---/.match(yaml)

  YAML.load_dj(yaml)
end