Class: TimeCamp::ResourceCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-timecamp/resource_collection.rb

Direct Known Subclasses

EntryCollection, TaskCollection, UserCollection

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ResourceCollection

Returns a new instance of ResourceCollection.



3
4
5
# File 'lib/ruby-timecamp/resource_collection.rb', line 3

def initialize(response)
  @resources = []
end

Instance Method Details

#[](index) ⇒ Object



11
12
13
# File 'lib/ruby-timecamp/resource_collection.rb', line 11

def [](index)
  return @resources[index]
end

#each(&block) ⇒ Object



15
16
17
# File 'lib/ruby-timecamp/resource_collection.rb', line 15

def each(&block)
  return @resources.each(&block)
end

#map(&block) ⇒ Object



19
20
21
# File 'lib/ruby-timecamp/resource_collection.rb', line 19

def map(&block)
  return @resources.map(&block)
end

#select(&block) ⇒ Object



23
24
25
# File 'lib/ruby-timecamp/resource_collection.rb', line 23

def select(&block)
  return @resources.select(&block)
end

#sizeObject



7
8
9
# File 'lib/ruby-timecamp/resource_collection.rb', line 7

def size
  return @resources.size
end