module Yt::Actions::Modify

Abstract module that contains methods common to Delete and Update

Private Instance Methods

do_modify(params = {}) { |body| ... } click to toggle source
# File lib/yt/actions/modify.rb, line 13
def do_modify(params = {})
  response = modify_request(params).run
  yield response.body if block_given?
end
modify_params() click to toggle source
# File lib/yt/actions/modify.rb, line 24
def modify_params
  path = "/youtube/v3/#{self.class.to_s.demodulize.pluralize.camelize :lower}"

  {}.tap do |params|
    params[:path] = path
    params[:auth] = @auth
    params[:host] = 'www.googleapis.com'
    params[:expected_response] = Net::HTTPNoContent
    params[:api_key] = Yt.configuration.api_key if Yt.configuration.api_key
  end
end
modify_request(params = {}) click to toggle source
# File lib/yt/actions/modify.rb, line 18
def modify_request(params = {})
  Yt::Request.new(params).tap do |request|
    print "#{request.as_curl}\n" if Yt.configuration.developing?
  end
end