Class: Markety::Response::GetCustomObjectResponse

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

Instance Attribute Summary

Attributes inherited from GenericResponse

#error_message

Instance Method Summary collapse

Methods inherited from GenericResponse

#success?, #to_hash, #to_xml

Constructor Details

#initialize(response) ⇒ GetCustomObjectResponse

Returns a new instance of GetCustomObjectResponse.



4
5
6
# File 'lib/markety/response/get_custom_object_response.rb', line 4

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

Instance Method Details

#custom_objectObject



16
17
18
# File 'lib/markety/response/get_custom_object_response.rb', line 16

def custom_object
  custom_objects.first
end

#custom_objectsObject



8
9
10
11
12
13
14
# File 'lib/markety/response/get_custom_object_response.rb', line 8

def custom_objects
  @custom_objects ||= begin
    custom_object_list.map do |custom_obj_hash|
      CustomObject.from_marketo_hash(object_type_name, custom_obj_hash)
    end
  end
end