Class: Markety::Response::SyncCustomObjectResponse

Inherits:
GenericResponse show all
Defined in:
lib/markety/response/sync_custom_object_response.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from GenericResponse

#to_hash, #to_xml

Constructor Details

#initialize(response) ⇒ SyncCustomObjectResponse

Returns a new instance of SyncCustomObjectResponse.



7
8
9
# File 'lib/markety/response/sync_custom_object_response.rb', line 7

def initialize(response)
  super(:sync_custom_objects_response, response)
end

Instance Attribute Details

#statusObject

Returns the value of attribute status.



5
6
7
# File 'lib/markety/response/sync_custom_object_response.rb', line 5

def status
  @status
end

Instance Method Details

#error_messageObject



19
20
21
# File 'lib/markety/response/sync_custom_object_response.rb', line 19

def error_message
  @error_message ||= custom_obj_hash[:error]
end

#success?Boolean

Returns:

  • (Boolean)


11
12
13
# File 'lib/markety/response/sync_custom_object_response.rb', line 11

def success?
  @success && !failed?
end

#updated_custom_objectObject



23
24
25
# File 'lib/markety/response/sync_custom_object_response.rb', line 23

def updated_custom_object
  CustomObject.from_marketo_hash(object_type_name, custom_obj_hash) if success?
end