Sha256: f4e1849881651937bec860828ef36c8e10261dd7412e40ab12305e85fb65516f

Contents?: true

Size: 389 Bytes

Versions: 4

Compression:

Stored size: 389 Bytes

Contents

# frozen_string_literal: true

module KeyTree
  #
  # Mixin for adding a meta_data key tree
  #
  module MetaData
    #
    # Get the meta_data for an object
    #
    def meta_data
      @meta_data ||= KeyTree::Tree.new
    end

    # Execute a block with meta data, returning self
    #
    def with_meta_data
      yield(meta_data)
      self
    end
  end
end

require_relative 'tree'

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
key_tree-0.8.0 lib/key_tree/meta_data.rb
key_tree-0.7.0 lib/key_tree/meta_data.rb
key_tree-0.6.1 lib/key_tree/meta_data.rb
key_tree-0.6.0 lib/key_tree/meta_data.rb