class Rundeck::Client

Wrapper for the Rundeck REST API.

Public Instance Methods

objectify(result) click to toggle source

Turn a hash into an object for easy accessibility.

@note This method will objectify nested hashes/arrays.

@param [Hash, Array] result An array or hash of results to turn into

an object

@return [Rundeck::ObjectifiedHash] if result was a hash @return [Rundeck::ObjectifiedHash] if result was an array @raise [Array<Rundeck::Error::Parsing>] Error objectifying array or hash

# File lib/rundeck/client.rb, line 70
def objectify(result)
  if result.is_a?(Hash)
    ObjectifiedHash.new(result)
  elsif result.is_a?(Array)
    result.map { |e| ObjectifiedHash.new(e) }
  elsif result.nil?
    nil
  else
    fail Error::Parsing, "Couldn't parse a response body"
  end
end