Class: Memstat::Proc::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/memstat/proc/base.rb

Direct Known Subclasses

Smaps, Status

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Base

Returns a new instance of Base.

Raises:



6
7
8
9
10
# File 'lib/memstat/proc/base.rb', line 6

def initialize(options = {})
  raise Error.new('path or pid must be given') unless options[:path] || options[:pid]
  @pid  = options[:pid]
  @path = options[:path]
end

Instance Attribute Details

#pathObject

Returns the value of attribute path.



4
5
6
# File 'lib/memstat/proc/base.rb', line 4

def path
  @path
end

#pidObject

Returns the value of attribute pid.



4
5
6
# File 'lib/memstat/proc/base.rb', line 4

def pid
  @pid
end

Instance Method Details

#pid?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/memstat/proc/base.rb', line 12

def pid?
  !!@pid
end