Class: Markety::Response::SyncCustomObjectResponse

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

Instance Attribute Summary collapse

Attributes inherited from GenericResponse

#error_message

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

#custom_objectsObject



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

def custom_objects
  return [] unless success?
  @custom_objects ||= begin
    custom_obj_hash.map do |single_custom_obj_hash|
      CustomObject.from_marketo_hash(object_type_name, single_custom_obj_hash)
    end
  end
end

#success?Boolean

Returns:

  • (Boolean)


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

def success?
  @success
end