lib/you_tube/resources/channels.rb
# Retrieve a Channel by its ID or Username
Retrieve a Channel by its ID or Username
Retrieve a Channel by its ID or Username
def retrieve(id: nil, username: nil)
      attrs = {}
      attrs[:id] = id if id
      attrs[:forUsername] = username if username
      response = get_request "channels", params: attrs.merge({part: PARTS})
      return nil if response.body["pageInfo"]["totalResults"] == 0
      Channel.new(response.body["items"][0])
    end
def retrieve ( id : nil , username : nil ) attrs = { } attrs [ :id ] = id if id attrs [ :forUsername ] = username if username response = get_request "channels" , params : attrs . merge ( { part : PARTS } ) return nil if response . body [ "pageInfo" ] [ "totalResults" ] == 0 Channel . new ( response . body [ "items" ] [ 0 ] ) end
Retrieve a Channel by its ID or Username
Retrieve a Channel by its ID or Username
id
<not_specific>
username
<not_specific>