Method: CloudFlock::Task::ServerProfile#select_entries
- Defined in:
- lib/cloudflock/task/server-profile.rb
#select_entries(section, name) ⇒ Object
Public: Select values from within entries, specifying both section and entry names.
section - String or Regexp specifying the section name. name - String or Regexp specifying the desired entry’s name.
Examples
profile.select_entries('Memory Statistics', 'Used RAM')
# => [...]
profile.select_entries(/Memory/, 'Used RAM')
# => [...]
Returns an Array of Strings.
74 75 76 77 78 |
# File 'lib/cloudflock/task/server-profile.rb', line 74 def select_entries(section, name) entries = select { |header| header.match section } filtered = entries.select { |entry| name.match entry.name } filtered.map(&:values) end |