Class: MarketoAPI::MObjects::Get
- Inherits:
-
Object
- Object
- MarketoAPI::MObjects::Get
- 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
-
#mobjects ⇒ Object
readonly
The list of Marketo objects.
-
#return_count ⇒ Object
readonly
The number of MObjects returned from MObjects#get.
-
#stream_position ⇒ Object
readonly
The stream position used for paging in MObjects#get.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Get
constructor
A new instance of Get.
-
#more? ⇒ Boolean
Returns
true
if there are more objects to be returned.
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
#mobjects ⇒ Object (readonly)
The list of Marketo objects.
89 90 91 |
# File 'lib/marketo_api/mobjects.rb', line 89 def mobjects @mobjects end |
#return_count ⇒ Object (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_position ⇒ Object (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.
103 104 105 |
# File 'lib/marketo_api/mobjects.rb', line 103 def more? !!@more end |