Skip to content

Commit

Permalink
add support for each, first & last to collections
Browse files Browse the repository at this point in the history
  • Loading branch information
deanpcmad committed Jun 27, 2024
1 parent 3ea35c5 commit 12efc11
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/twitch/collection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,17 @@ def initialize(data:, total:, cursor:)
@total = total
@cursor = cursor.nil? ? nil : cursor
end

def each(&block)
data.each(&block)
end

def first
data.first
end

def last
data.last
end
end
end

0 comments on commit 12efc11

Please sign in to comment.