Sha256: e8187d91f77c9e027dbc785e9a44a3885e63c5bbd1a412ef0d11f6a3d5ca8f4e

Contents?: true

Size: 174 Bytes

Versions: 16

Compression:

Stored size: 174 Bytes

Contents

class OpenStruct
  def to_hash
    self.each_pair.with_object({}) do |(key, value), hash|
      hash[key] = value.is_a?(OpenStruct) ? value.to_hash : value
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
mkit-0.9.0 lib/mkit/config/initializers/002_openstruct.rb
mkit-0.8.0 lib/mkit/config/initializers/002_openstruct.rb
mkit-0.7.2 lib/mkit/config/initializers/002_openstruct.rb
mkit-0.7.1 lib/mkit/config/initializers/002_openstruct.rb
mkit-0.7.0 lib/mkit/config/initializers/002_openstruct.rb
mkit-0.6.3 lib/mkit/config/initializers/002_openstruct.rb
mkit-0.6.2 lib/mkit/config/initializers/002_openstruct.rb
mkit-0.6.1 lib/mkit/config/initializers/002_openstruct.rb
mkit-0.6.0 lib/mkit/config/initializers/002_openstruct.rb
mkit-0.5.0 lib/mkit/config/initializers/002_openstruct.rb
mkit-0.4.3 lib/mkit/config/initializers/002_openstruct.rb
mkit-0.4.2 lib/mkit/config/initializers/002_openstruct.rb
mkit-0.4.1 lib/mkit/config/initializers/002_openstruct.rb
mkit-0.4.0 lib/mkit/config/initializers/002_openstruct.rb
mkit-0.3.0 lib/mkit/config/initializers/002_openstruct.rb
mkit-0.2.0 lib/mkit/config/initializers/002_openstruct.rb