Sha256: dbd7a9fc44e7437f1b28bfadfb5fa0b38f6e55846a0da1f6d6440d104be92eda

Contents?: true

Size: 534 Bytes

Versions: 1

Compression:

Stored size: 534 Bytes

Contents

# frozen_string_literal: true

module SiteHealth
  class CheckData
    include Enumerable

    def initialize
      @data = {}
    end

    def [](key)
      @data[key]
    end

    # Adds data
    # @param [Hash] the hash to be added
    # @return [Hash] the current data
    def add(hash)
      @data.merge!(hash)
    end

    # @return [TrueClass, FalseClass] true if there is no data
    def empty?
      @data.empty?
    end

    def each(&block)
      @data.each(&block)
    end

    def to_h
      @data.to_h
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
site_health-0.2.0 lib/site_health/check_data.rb