class VpsbClient::Builders::MemoryParser
Constants
- REGEX_AVAIL
- REGEX_CACHE
- REGEX_TOTAL
Attributes
free[R]
total[R]
used[R]
Public Class Methods
new()
click to toggle source
Calls superclass method
VpsbClient::Builders::SystemInfoParser::new
# File lib/vpsb_client/builders/system_info_parser.rb, line 38 def initialize super('free') end
Public Instance Methods
parse()
click to toggle source
# File lib/vpsb_client/builders/system_info_parser.rb, line 42 def parse matches = find_matches(REGEX_CACHE) if matches @used = matches[:used].to_i @free = matches[:free].to_i elsif matches = find_matches(REGEX_AVAIL) @used = matches[:used].to_i @free = matches[:avail].to_i else raise NoMatchError, "No regex matches 'free' output" end matches = find_matches!(REGEX_TOTAL) @total = matches[:total].to_i end