Class: BingAdsApi::AdApiFaultDetail

Inherits:
ApplicationFault show all
Defined in:
lib/bing-ads-api/fault/ad_api_fault_detail.rb

Overview

Public : Defines a fault object that operations return when generic errors occur, such as an authentication error.

Author

[email protected]

Instance Attribute Summary collapse

Attributes inherited from ApplicationFault

#tracking_id

Instance Method Summary collapse

Methods included from SOAPHasheable

#date_to_hash, #get_attribute_key, #normalize_hash_keys, #object_to_hash, #to_hash

Constructor Details

#initialize(attributes = {}) ⇒ AdApiFaultDetail

Public : Constructor

Author

[email protected]

attributes - Hash with the initial attributes

Attributes

  • tracking_id : the operation tracking id value

  • errors : array of hashes with the Ad api errors



22
23
24
25
26
27
# File 'lib/bing-ads-api/fault/ad_api_fault_detail.rb', line 22

def initialize(attributes={})
  super(attributes)
  if attributes
    initialize_errors(attributes[:errors])
  end
end

Instance Attribute Details

#errorsObject

Returns the value of attribute errors.



11
12
13
# File 'lib/bing-ads-api/fault/ad_api_fault_detail.rb', line 11

def errors
  @errors
end

Instance Method Details

#to_sObject

Public : Specified to string method

Author

[email protected]



32
33
34
35
36
37
38
39
# File 'lib/bing-ads-api/fault/ad_api_fault_detail.rb', line 32

def to_s
  str = super.to_s + ":\n" 
  if errors
    str += "\tErrors:\n" + errors.map{ |e| "\t" + e.to_s }.join("\n")
  end
  
  return str
end