Class: Rabbit::YAMLLoader

Inherits:
Object
  • Object
show all
Defined in:
lib/rabbit/yaml-loader.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(yaml) ⇒ YAMLLoader

Returns a new instance of YAMLLoader.


28
29
30
# File 'lib/rabbit/yaml-loader.rb', line 28

def initialize(yaml)
  @yaml = yaml
end

Class Method Details

.load(yaml) ⇒ Object


23
24
25
# File 'lib/rabbit/yaml-loader.rb', line 23

def load(yaml)
  new(yaml).load
end

Instance Method Details

#loadObject


32
33
34
35
36
37
# File 'lib/rabbit/yaml-loader.rb', line 32

def load
  YAML.safe_load(@yaml,
                 permitted_classes: [
                   Date, Symbol,
                 ])
end