Parsing YAML FILE
YAML
YAML is a flexible, human readable file format. It is easier to read (by humans) than JSON.
YAML File
– Name: Don
Age: 35
City: YYY
– Name: Peter
Age: 30
City: XXX
Ruby Code
require 'yaml'file_content= YAML.load_file("Name of the file")p file_content
Output
[{"Name"=>"Don", "Age"=>35, "City"=>"YYY"}, {"Name"=>"Peter", "Age"=>30, "City"=>"XXX"}]
Advertisements