Sha256: 7b556a8a3e795ad8620ddd837c28d474fcdd23f3dd50b20ced8169e4ea3825dd

Contents?: true

Size: 257 Bytes

Versions: 13

Compression:

Stored size: 257 Bytes

Contents

module OpenStructToHash
  def to_hash
    # from: http://snippets.dzone.com/posts/show/7312
    h = @table
    # handles nested structures
    h.each do |k,v|
      if v.class == OpenStruct
        h[k] = v._to_hash
      end
    end
    return h
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
albacore-1.0.0 lib/albacore/support/openstruct.rb
albacore-1.0.0.rc.3 lib/albacore/support/openstruct.rb
albacore-0.3.6 lib/albacore/support/openstruct.rb
albacore-1.0.0.rc.2 lib/albacore/support/openstruct.rb
albacore-1.0.0.rc.1 lib/albacore/support/openstruct.rb
albacore-0.3.5 lib/albacore/support/openstruct.rb
albacore-0.3.4 lib/albacore/support/openstruct.rb
albacore-0.3.3 lib/albacore/support/openstruct.rb
albacore-0.3.2 lib/albacore/support/openstruct.rb
albacore-0.3.1 lib/albacore/support/openstruct.rb
albacore-0.3.0 lib/albacore/support/openstruct.rb
albacore-0.2.7 lib/albacore/support/openstruct.rb
albacore-0.2.6 lib/albacore/support/openstruct.rb