Module: CloudParty::Response

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



5
6
7
8
# File 'lib/cloud_party/response.rb', line 5

def self.included(base)
  base.include CloudParty::Responses::ResponseMethods
  base.attr_reader :body, :parsed_response, :code, :errors, :messages, :results, :result
end

Instance Method Details

#check_result_type(result_json_object) ⇒ Object

Parameters:

  • result_json_object (Result)

    check result type for parsing

Raises:

  • (UnRecognizedResultTypeError)

    when the result type is neither Hash nor Array



15
16
17
18
19
20
21
22
23
# File 'lib/cloud_party/response.rb', line 15

def check_result_type(result_json_object)
  if result_json_object.is_a?(Hash)
    'Hash'
  elsif result_json_object.is_a?(Array)
    'Array'
  else
    raise UnRecognizedResultTypeError, result_json_object.class
  end
end

#filter_by_account(account) ⇒ Object



10
11
12
# File 'lib/cloud_party/response.rb', line 10

def ()
  # blah
end