Class: MarketoAPI::MObjects::Get

Inherits:
Object
  • Object
show all
Defined in:
lib/marketo_api/mobjects.rb

Overview

A response object to MObjects#get that includes the return count, the new stream position, and the list of MObject records.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hash) ⇒ Get

Returns a new instance of Get.



91
92
93
94
95
96
97
98
99
100
# File 'lib/marketo_api/mobjects.rb', line 91

def initialize(hash)
  @return_count = hash[:return_count].to_i
  @more = hash[:has_more]
  @stream_position = hash[:new_stream_position]
  objects = MarketoAPI.array(hash[:m_object_list])

  @mobjects = objects.map { |object|
    MarketoAPI::MObject.from_soap_hash(object[:m_object])
  }
end

Instance Attribute Details

#mobjectsObject (readonly)

The list of Marketo objects.



89
90
91
# File 'lib/marketo_api/mobjects.rb', line 89

def mobjects
  @mobjects
end

#return_countObject (readonly)

The number of MObjects returned from MObjects#get.



84
85
86
# File 'lib/marketo_api/mobjects.rb', line 84

def return_count
  @return_count
end

#stream_positionObject (readonly)

The stream position used for paging in MObjects#get. This may be shared with each MObject in #mobjects.



87
88
89
# File 'lib/marketo_api/mobjects.rb', line 87

def stream_position
  @stream_position
end

Instance Method Details

#more?Boolean

Returns true if there are more objects to be returned.

Returns:

  • (Boolean)


103
104
105
# File 'lib/marketo_api/mobjects.rb', line 103

def more?
  !!@more
end