Sha256: 043a3abc68a052cff11d40742f19bb375011f8903333fb8df8ff660b8f93fd18

Contents?: true

Size: 282 Bytes

Versions: 34

Compression:

Stored size: 282 Bytes

Contents

module Bixby

# Adds to_hash method to an Object
module Hashify

  # Creates a Hash representation of self
  #
  # @return [Hash]
  def to_hash
    self.instance_variables.inject({}) { |m,v| m[v[1,v.length].to_sym] = instance_variable_get(v); m }
  end

end # Hashify

end # Bixby

Version data entries

34 entries across 34 versions & 2 rubygems

Version Path
bixby-common-0.7.1 lib/bixby-common/util/hashify.rb
bixby-common-0.7.0 lib/bixby-common/util/hashify.rb
bixby-common-0.6.6 lib/bixby-common/util/hashify.rb
bixby-common-0.6.5 lib/bixby-common/util/hashify.rb
bixby-common-0.6.4 lib/bixby-common/util/hashify.rb
bixby-common-0.6.3 lib/bixby-common/util/hashify.rb
bixby-common-0.6.2 lib/bixby-common/util/hashify.rb
bixby-common-0.6.1 lib/bixby-common/util/hashify.rb
bixby-common-0.6.0 lib/bixby-common/util/hashify.rb
bixby-common-0.5.0 lib/bixby-common/util/hashify.rb
bixby-common-0.4.13 lib/bixby-common/util/hashify.rb
bixby-common-0.4.12 lib/bixby-common/util/hashify.rb
bixby-common-0.4.11 lib/bixby-common/util/hashify.rb
bixby-common-0.4.10 lib/bixby-common/util/hashify.rb
bixby-common-0.4.9 lib/bixby-common/util/hashify.rb
bixby-common-0.4.8 lib/bixby-common/util/hashify.rb
bixby-common-0.4.7 lib/bixby-common/util/hashify.rb
bixby-common-0.4.6 lib/bixby-common/util/hashify.rb
bixby-common-0.4.5 lib/bixby-common/util/hashify.rb
bixby-common-0.4.4 lib/bixby-common/util/hashify.rb