Sha256: 6e9fbe6efc4e5efec8f747b45eb126a5948fc96754056a0b733d5bb6dda8e0ab

Contents?: true

Size: 660 Bytes

Versions: 23

Compression:

Stored size: 660 Bytes

Contents

module Hobo
    class Metadata
    class << self
      attr_accessor :metadata, :store, :defaults

      def store
        @store ||= {}
      end

      def metadata
        @metadata ||= {}
      end

      def default type, value
        @defaults ||= {}
        @defaults[type] = value
        store[type] = value if store[type].nil?
      end

      def add task, type, data = nil
        data = store[type] if data.nil?
        metadata[task] ||= {}
        metadata[task][type] = data
      end

      def reset_store
        @store = {}
        @defaults.each do |k, v|
          @store[k] = v.nil? ? nil : v.dup
        end
      end
    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
hobo-inviqa-0.0.15 lib/hobo/metadata.rb
hobo-inviqa-0.0.14 lib/hobo/metadata.rb
hobo-inviqa-0.0.13 lib/hobo/metadata.rb
hobo-inviqa-0.0.11 lib/hobo/metadata.rb
hobo-inviqa-0.0.10 lib/hobo/metadata.rb
hobo-inviqa-0.0.10.pre.rc11 lib/hobo/metadata.rb
hobo-inviqa-0.0.10.pre.rc10 lib/hobo/metadata.rb
hobo-inviqa-0.0.10.pre.rc9 lib/hobo/metadata.rb
hobo-inviqa-0.0.10.pre.rc8 lib/hobo/metadata.rb
hobo-inviqa-0.0.10.pre.rc7 lib/hobo/metadata.rb
hobo-inviqa-0.0.10.pre.rc6 lib/hobo/metadata.rb
hobo-inviqa-0.0.10.pre.rc4 lib/hobo/metadata.rb
hobo-inviqa-0.0.10.pre.rc2 lib/hobo/metadata.rb
hobo-inviqa-0.0.9 lib/hobo/metadata.rb
hobo-inviqa-0.0.9.pre.rc2 lib/hobo/metadata.rb
hobo-inviqa-0.0.9.pre.rc1 lib/hobo/metadata.rb
hobo-inviqa-0.0.9.pre.alpha lib/hobo/metadata.rb
hobo-inviqa-0.0.8 lib/hobo/metadata.rb
hobo-inviqa-0.0.7.pre.rc3 lib/hobo/metadata.rb
hobo-inviqa-0.0.7.pre.rc2 lib/hobo/metadata.rb