Method: BOTR::Channel#update

Defined in:
lib/botr/channels/channel.rb

#update(**options) ⇒ BOTR::Channel

Configure or update the properties of a channel.

Parameters:

  • options (Hash)

    channel parameters

Options Hash (**options):

  • channel_key (String)

    key of the channel which should be configured or updated

  • title (String)

    title of the channel

  • description (String)

    description of the channel

  • link (String)

    user defined URL

  • author (String)

    author of the channel

  • tags (String)

    tags of the channel; restricts the inclusion of videos to the channel to the videos tagged with the specified tags

  • tags_mode (String)

    tags search mode for the dynamic channel: "all" -- a video will only be added if it has all tags specified in the tags parameter or "any" -- a video will be added if it has at least one tag specified in the tags parameter

  • sort_order (String)

    specifies sorting order of the videos in a dynamic channel: "date-asc", "date-desc", "title-asc", "title-desc", "duration-asc", "duration-desc", "views-asc" or "views-desc"

  • videos_max (Integer)

    maximum number of videos to allow in a dynamic channel; default is 10

Returns:

  • (BOTR::Channel)

    this object with the properties specified in the options hash



156
157
158
159
160
161
162
163
164
165
166
167
# File 'lib/botr/channels/channel.rb', line 156

def update(**options)
  json = put_request(options.merge(:channel_key => @key))
  res = JSON.parse(json.body)

  if json.status == 200
    process_update_response(res, options)
  else
    raise "HTTP Error #{json.status}: #{json.body}"
  end

  return self
end