Sha256: b1e0edcd59d18440098d2091194b5f608038209832e298410de03b2a97082814
Contents?: true
Size: 468 Bytes
Versions: 3
Compression:
Stored size: 468 Bytes
Contents
module Rupture::Meta def meta @_meta ||= {} end def clone(meta = nil) meta ||= @_meta.clone if @_meta raise "meta must be of type Hash, it is #{meta.class}" unless meta.nil? or meta.kind_of?(Hash) or meta.kind_of?(Rupture::HashMap) copy = super() copy.instance_variable_set(:@_meta, meta) copy end def with_meta(meta) clone(meta) end def vary_meta(*args, &fn) fn ||= args.shift with_meta(fn[meta, *args]) end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
rupture-0.3.0 | lib/rupture/meta.rb |
rupture-0.2.1 | lib/rupture/meta.rb |
rupture-0.2.0 | lib/rupture/meta.rb |