Sha256: dae56e5cd0f40bad9fb4a72ed3fc974ce01c76e494992fb91aef717c10f1b623
Contents?: true
Size: 345 Bytes
Versions: 16
Compression:
Stored size: 345 Bytes
Contents
module Maestrano # Extend OpenStruct to include a 'attributes' method class OpenStruct < ::OpenStruct # Return all object defined attributes def attributes if self.respond_to?(:to_h) self.to_h.keys else (self.methods - self.class.new.methods).reject {|method| method =~ /=$/ } end end end end
Version data entries
16 entries across 16 versions & 1 rubygems