Sha256: 81703abe2814656f27a0c48072bbbb51247af1f05736fb97fd0889bfbfb66078
Contents?: true
Size: 563 Bytes
Versions: 11
Compression:
Stored size: 563 Bytes
Contents
module Ridgepole module Ext module PpSortHash def pretty_print(q) q.group(1, '{', '}') { q.seplist(self.sort_by {|k, _| k.to_s } , nil, :each) {|k, v| q.group { q.pp k q.text '=>' q.group(1) { q.breakable '' q.pp v } } } } end def self.extend_if_hash(obj) if obj.kind_of?(Hash) obj = obj.dup obj.extend(self) end obj end end end end
Version data entries
11 entries across 11 versions & 1 rubygems