lib/nimbu-api/endpoints/videos.rb in nimbu-api-0.4.4 vs lib/nimbu-api/endpoints/videos.rb in nimbu-api-0.5.0

- old
+ new

@@ -1,26 +1,24 @@ # encoding: utf-8 +# frozen_string_literal: true module Nimbu module Endpoints class Videos < Endpoint - - def list(*args) + def list(*args, &block) arguments(args) response = get_request("/videos", arguments.params) return response unless block_given? - response.each { |el| yield el } + response.each(&block) end - alias :all :list + alias_method :all, :list def get(*args) - arguments(args, :required => [:video_id]) + arguments(args, required: [:video_id]) get_request("/videos/#{video_id}", arguments.params) end - alias :find :get - - + alias_method :find, :get end # Authorizations end # Endpoints end # Nimbu