binding ruby: Use YAML.dump instead of to_yaml
binding ruby: Add nil check
binding ruby: De-serialize each value