Class: Vmstator::SlabInfo

Inherits:
Object
  • Object
show all
Defined in:
lib/vmstator/linux/slab_info.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data = false) ⇒ SlabInfo

Returns a new instance of SlabInfo.



7
8
9
10
11
12
13
# File 'lib/vmstator/linux/slab_info.rb', line 7

def initialize(data=false)
  @caches = []
  if data
    update(data)
  end
  true
end

Instance Attribute Details

#cachesObject (readonly)

attrs for each attribute



5
6
7
# File 'lib/vmstator/linux/slab_info.rb', line 5

def caches
  @caches
end

Instance Method Details

#update(data) ⇒ Object



15
16
17
18
19
20
21
22
# File 'lib/vmstator/linux/slab_info.rb', line 15

def update(data)
  if data
    @caches << Cache.new(data)
  else
    return false
  end
  true
end