Module: Puppet::ReportAllTheThings::Helper
- Defined in:
- lib/puppet/reportallthethings/helper.rb
Class Method Summary (collapse)
Class Method Details
+ (Object) report_all_the_things(things)
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/puppet/reportallthethings/helper.rb', line 10 def self.report_all_the_things(things) case things when Hash things.inject({}){ |hash, (k,v)| hash.merge( k => report_all_the_things(v)) } when Array things.map { |v| report_all_the_things(v) } else things.respond_to?(:to_data_hash) ? report_all_the_things(things.to_data_hash) : things end end |
+ (Object) symbolize(string)
4 5 6 7 8 |
# File 'lib/puppet/reportallthethings/helper.rb', line 4 def self.symbolize(string) string = String(string) if string.is_a?(Symbol) raise StandardError, "Recieved a #{string.class} but expected a String!" unless string.is_a?(String) String(string).sub(/^@/, '').to_sym end |