Class: Rabbit::YAMLLoader
- Inherits:
-
Object
- Object
- Rabbit::YAMLLoader
- Defined in:
- lib/rabbit/yaml-loader.rb
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(yaml) ⇒ YAMLLoader
constructor
A new instance of YAMLLoader.
- #load ⇒ Object
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
#load ⇒ Object
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 |