Class: ContextIO::ThreadCollection

Inherits:
Object
  • Object
show all
Includes:
API::ResourceCollection
Defined in:
lib/contextio/thread_collection.rb

Instance Attribute Summary

Attributes included from API::ResourceCollection

#resource_url, #where_constraints

Instance Method Summary collapse

Methods included from API::ResourceCollection

#[], #empty?, #size, #where

Instance Method Details

#each(&block) ⇒ Object

Iterates over the resources in question.

Examples:

contextio.connect_tokens.each do |connect_token|
  puts connect_token.email
end


19
20
21
22
23
# File 'lib/contextio/thread_collection.rb', line 19

def each(&block)
  attribute_hashes.each do |actually_a_resource_url|
    yield resource_class.new(api, {resource_url: actually_a_resource_url}.merge(associations_hash))
  end
end