class FacebookAds::ServerSide::EventResponse
Attributes
events_received[RW]
number of events received.
fbtrace_id[RW]
Facebook API trace id
messages[RW]
Response message
Public Class Methods
new(events_received: nil, messages: nil, fbtrace_id: nil)
click to toggle source
@param [String] events_received
@param [Array()String)] messages @param [String] fbtrace_id
# File lib/facebook_ads/ad_objects/server_side/event_response.rb, line 36 def initialize(events_received: nil, messages: nil, fbtrace_id: nil) unless events_received.nil? self.events_received = events_received end unless messages.nil? self.messages = messages end unless fbtrace_id.nil? self.fbtrace_id = fbtrace_id end end
Public Instance Methods
==(o)
click to toggle source
Checks equality by comparing each attribute.
# File lib/facebook_ads/ad_objects/server_side/event_response.rb, line 72 def ==(o) return true if self.equal?(o) self.class == o.class && events_received == o.events_received && messages == o.messages && fbtrace_id == o.fbtrace_id end
build(attributes = {})
click to toggle source
build the object using the input hash @param [Hash] attributes attributes in the form of hash
# File lib/facebook_ads/ad_objects/server_side/event_response.rb, line 50 def build(attributes = {}) return unless attributes.is_a?(Hash) # convert string to symbol for hash key attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v } if attributes.has_key?(:'events_received') self.events_received = attributes[:'events_received'] end if attributes.has_key?(:'messages') if (value = attributes[:'messages']).is_a?(Array) self.messages = value end end if attributes.has_key?(:'fbtrace_id') self.fbtrace_id = attributes[:'fbtrace_id'] end end
eql?(o)
click to toggle source
@see the `==` method
# File lib/facebook_ads/ad_objects/server_side/event_response.rb, line 81 def eql?(o) self == o end
hash()
click to toggle source
Calculates hash code according to all attributes. @return [Fixnum] Hash
code
# File lib/facebook_ads/ad_objects/server_side/event_response.rb, line 87 def hash [events_received, messages, fbtrace_id].hash end
to_s()
click to toggle source
# File lib/facebook_ads/ad_objects/server_side/event_response.rb, line 91 def to_s hash = {} unless events_received.nil? hash['events_received'] = events_received end unless messages.nil? hash['messages'] = messages end unless fbtrace_id.nil? hash['fbtrace_id'] = fbtrace_id end hash.to_s end