Class: Bitly::API::List

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/bitly/api/list.rb

Overview

A base class for lists of API resources. Implements Enumerable.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(items:, response:) ⇒ List

Returns a new instance of List.



12
13
14
15
# File 'lib/bitly/api/list.rb', line 12

def initialize(items:, response:)
  @items = items
  @response = response
end

Instance Attribute Details

#responseObject (readonly)

Returns the value of attribute response.



10
11
12
# File 'lib/bitly/api/list.rb', line 10

def response
  @response
end

Instance Method Details

#eachObject



17
18
19
# File 'lib/bitly/api/list.rb', line 17

def each
  @items.each { |item| yield item }
end