Class: SiteHealth::CheckData

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/site_health/check_data.rb

Instance Method Summary collapse

Constructor Details

#initializeCheckData

Returns a new instance of CheckData.



7
8
9
# File 'lib/site_health/check_data.rb', line 7

def initialize
  @data = {}
end

Instance Method Details

#[](key) ⇒ Object



11
12
13
# File 'lib/site_health/check_data.rb', line 11

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

#add(hash) ⇒ Hash

Adds data

Parameters:

  • the (Hash)

    hash to be added

Returns:

  • (Hash)

    the current data



18
19
20
# File 'lib/site_health/check_data.rb', line 18

def add(hash)
  @data.merge!(hash)
end

#each(&block) ⇒ Object



27
28
29
# File 'lib/site_health/check_data.rb', line 27

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

#empty?TrueClass, FalseClass

Returns true if there is no data.

Returns:

  • (TrueClass, FalseClass)

    true if there is no data



23
24
25
# File 'lib/site_health/check_data.rb', line 23

def empty?
  @data.empty?
end

#to_hObject



31
32
33
# File 'lib/site_health/check_data.rb', line 31

def to_h
  @data.to_h
end