We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e7a8184 + be6d8dd commit bda45beCopy full SHA for bda45be
lib/puppet/resource_api/glue.rb
@@ -41,6 +41,10 @@ def to_hierayaml
41
YAML.dump('type' => { title => attributes }).split("\n").drop(2).join("\n") + "\n"
42
end
43
44
+ def to_hash
45
+ values
46
+ end
47
+
48
# attribute names that are not title or namevars
49
def filtered_keys
50
values.keys.reject { |k| k == :title || !attr_def[k] || (attr_def[k][:behaviour] == :namevar && @namevars.size == 1) }
spec/puppet/resource_api/glue_spec.rb
@@ -56,5 +56,9 @@
56
it { expect(instance.to_hierayaml).to eq " ? |-\n foo:\n bar\n : attr: value\n attr_ro: fixed\n" }
57
58
59
60
+ describe '.to_hash' do
61
+ it { expect(instance.to_hash).to eq(namevarname: 'title', attr: 'value', attr_ro: 'fixed') }
62
63
64
0 commit comments