Class: CheckDisk::Block

Inherits:
Template show all
Defined in:
lib/check_disk/blocks.rb

Overview

Interface for checking Inodes.

Instance Method Summary collapse

Constructor Details

#initialize(config) ⇒ Block

Returns a new instance of Block.



6
7
8
# File 'lib/check_disk/blocks.rb', line 6

def initialize(config)
  super
end

Instance Method Details

#availableObject



14
15
16
# File 'lib/check_disk/blocks.rb', line 14

def available
  blocks_available
end

#critical?TrueClass, FalseClass

Boolean method for determining if we are ‘critical?’

Returns:

  • (TrueClass, FalseClass)

    Critical True or False?



34
35
36
# File 'lib/check_disk/blocks.rb', line 34

def critical?
  percent_of_blocks_used > critical
end

#messageObject



38
39
40
41
# File 'lib/check_disk/blocks.rb', line 38

def message
  "#{ percent_of_blocks_used }% of blocks used. " \
  "path: #{ path } total: #{ total } available: #{ available }"
end

#percent_usedObject



22
23
24
# File 'lib/check_disk/blocks.rb', line 22

def percent_used
  percent_of_blocks_used
end

#totalObject



10
11
12
# File 'lib/check_disk/blocks.rb', line 10

def total
  blocks_total
end

#usedObject



18
19
20
# File 'lib/check_disk/blocks.rb', line 18

def used
  blocks_used
end

#warning?TrueClass, FalseClass

Boolean method for determining if we are ‘warning?’

Returns:

  • (TrueClass, FalseClass)

    Warning True or False?



28
29
30
# File 'lib/check_disk/blocks.rb', line 28

def warning?
  percent_of_blocks_used > warning
end