Class: Trumpet::Resource
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#to_h(excludes = []) ⇒ Object
4 5 6 7 8 9 10 |
# File 'lib/trumpet/resource.rb', line 4 def to_h(excludes=[]) excludes << '@credentials' instance_variables.inject({}) do |hash, value| hash[value.gsub('@', '')] = instance_variable_get(value) unless excludes.include?(value) hash end end |