Class: BOTR::Player
Class Attribute Summary collapse
-
.last_status ⇒ Object
readonly
Returns the value of attribute last_status.
Instance Attribute Summary collapse
-
#advertising ⇒ Object
readonly
Returns the value of attribute advertising.
-
#aspectratio ⇒ Object
readonly
Returns the value of attribute aspectratio.
-
#autostart ⇒ Object
readonly
Returns the value of attribute autostart.
-
#captions ⇒ Object
readonly
Returns the value of attribute captions.
-
#controlbar ⇒ Object
readonly
Returns the value of attribute controlbar.
-
#ga_web_property_id ⇒ Object
readonly
Returns the value of attribute ga_web_property_id.
-
#height ⇒ Object
readonly
Returns the value of attribute height.
-
#key ⇒ Object
readonly
Returns the value of attribute key.
-
#last_status ⇒ Object
readonly
Returns the value of attribute last_status.
-
#ltas_channel ⇒ Object
readonly
Returns the value of attribute ltas_channel.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#playlist ⇒ Object
readonly
Returns the value of attribute playlist.
-
#playlistsize ⇒ Object
readonly
Returns the value of attribute playlistsize.
-
#related_videos ⇒ Object
readonly
Returns the value of attribute related_videos.
-
#repeat ⇒ Object
readonly
Returns the value of attribute repeat.
-
#responsive ⇒ Object
readonly
Returns the value of attribute responsive.
-
#sharing ⇒ Object
readonly
Returns the value of attribute sharing.
-
#sharing_player_key ⇒ Object
readonly
Returns the value of attribute sharing_player_key.
-
#sitecatalyst ⇒ Object
readonly
Returns the value of attribute sitecatalyst.
-
#skin ⇒ Object
readonly
Returns the value of attribute skin.
-
#stretching ⇒ Object
readonly
Returns the value of attribute stretching.
-
#template ⇒ Object
readonly
Returns the value of attribute template.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
-
#views ⇒ Object
readonly
Returns the value of attribute views.
-
#watermark ⇒ Object
readonly
Returns the value of attribute watermark.
-
#width ⇒ Object
readonly
Returns the value of attribute width.
Class Method Summary collapse
- .all ⇒ Object
- .list(**options) ⇒ Object
- .show(key) ⇒ Object (also: find)
Instance Method Summary collapse
- #create(name, sharing_player_key, **options) ⇒ Object
- #delete ⇒ Object
-
#initialize(params = {}) ⇒ Player
constructor
A new instance of Player.
- #update(**options) ⇒ Object
Methods included from Authentication
Methods included from API
#api_call_class, #api_format, #api_key, #api_nonce, #api_protocol, #api_secret_key, #api_server, #api_timestamp, #api_url, #api_version, #progress_url, #upload_address, #upload_key, #upload_protocol, #upload_token, #upload_url
Methods included from HTTP
#client, #delete_request, #get_request, #post_request, #put_request
Constructor Details
#initialize(params = {}) ⇒ Player
Returns a new instance of Player.
69 70 71 72 73 74 75 |
# File 'lib/botr/players/player.rb', line 69 def initialize(params = {}) params.each do |key, val| param = "@#{key.to_s}" next unless methods.include? key.to_sym instance_variable_set(param, val) end end |
Class Attribute Details
.last_status ⇒ Object (readonly)
Returns the value of attribute last_status.
7 8 9 |
# File 'lib/botr/players/player.rb', line 7 def last_status @last_status end |
Instance Attribute Details
#advertising ⇒ Object (readonly)
Returns the value of attribute advertising.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def advertising @advertising end |
#aspectratio ⇒ Object (readonly)
Returns the value of attribute aspectratio.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def aspectratio @aspectratio end |
#autostart ⇒ Object (readonly)
Returns the value of attribute autostart.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def autostart @autostart end |
#captions ⇒ Object (readonly)
Returns the value of attribute captions.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def captions @captions end |
#controlbar ⇒ Object (readonly)
Returns the value of attribute controlbar.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def @controlbar end |
#ga_web_property_id ⇒ Object (readonly)
Returns the value of attribute ga_web_property_id.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def ga_web_property_id @ga_web_property_id end |
#height ⇒ Object (readonly)
Returns the value of attribute height.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def height @height end |
#key ⇒ Object (readonly)
Returns the value of attribute key.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def key @key end |
#last_status ⇒ Object (readonly)
Returns the value of attribute last_status.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def last_status @last_status end |
#ltas_channel ⇒ Object (readonly)
Returns the value of attribute ltas_channel.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def ltas_channel @ltas_channel end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def name @name end |
#playlist ⇒ Object (readonly)
Returns the value of attribute playlist.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def playlist @playlist end |
#playlistsize ⇒ Object (readonly)
Returns the value of attribute playlistsize.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def playlistsize @playlistsize end |
#related_videos ⇒ Object (readonly)
Returns the value of attribute related_videos.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def @related_videos end |
#repeat ⇒ Object (readonly)
Returns the value of attribute repeat.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def repeat @repeat end |
#responsive ⇒ Object (readonly)
Returns the value of attribute responsive.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def responsive @responsive end |
#sharing ⇒ Object (readonly)
Returns the value of attribute sharing.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def sharing @sharing end |
#sharing_player_key ⇒ Object (readonly)
Returns the value of attribute sharing_player_key.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def sharing_player_key @sharing_player_key end |
#sitecatalyst ⇒ Object (readonly)
Returns the value of attribute sitecatalyst.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def sitecatalyst @sitecatalyst end |
#skin ⇒ Object (readonly)
Returns the value of attribute skin.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def skin @skin end |
#stretching ⇒ Object (readonly)
Returns the value of attribute stretching.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def stretching @stretching end |
#template ⇒ Object (readonly)
Returns the value of attribute template.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def template @template end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def version @version end |
#views ⇒ Object (readonly)
Returns the value of attribute views.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def views @views end |
#watermark ⇒ Object (readonly)
Returns the value of attribute watermark.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def watermark @watermark end |
#width ⇒ Object (readonly)
Returns the value of attribute width.
62 63 64 |
# File 'lib/botr/players/player.rb', line 62 def width @width end |
Class Method Details
.all ⇒ Object
38 39 40 |
# File 'lib/botr/players/player.rb', line 38 def all list({}) end |
.list(**options) ⇒ Object
25 26 27 28 29 30 31 32 33 34 35 36 |
# File 'lib/botr/players/player.rb', line 25 def list(**) json = get_request(.merge(:method => 'list')) res = JSON.parse(json.body) if json.status == 200 results = process_list_response(res) else raise "HTTP Error #{json.status}: #{json.body}" end return results end |
.show(key) ⇒ Object Also known as: find
9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/botr/players/player.rb', line 9 def show(key) json = get_request({:method => 'show', :player_key => key}) res = JSON.parse(json.body) if json.status == 200 params = process_show_response(res) else raise "HTTP Error #{json.status}: #{json.body}" end return new(params) end |
Instance Method Details
#create(name, sharing_player_key, **options) ⇒ Object
77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/botr/players/player.rb', line 77 def create(name, sharing_player_key, **) json = get_request(.merge(:method => 'create', :name => name, :sharing_player_key => sharing_player_key)) res = JSON.parse(json.body) if json.status == 200 process_create_response(res, ) else raise "HTTP Error #{json.status}: #{json.body}" end return self end |
#delete ⇒ Object
106 107 108 109 110 111 112 113 114 115 116 117 |
# File 'lib/botr/players/player.rb', line 106 def delete json = delete_request({:player_key => @key}) res = JSON.parse(json.body) if json.status == 200 process_delete_response(res) else raise "HTTP Error #{json.status}: #{json.body}" end return self end |
#update(**options) ⇒ Object
92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/botr/players/player.rb', line 92 def update(**) json = put_request(.merge(:player_key => @key, :sharing_player_key => @sharing_player_key)) res = JSON.parse(json.body) if json.status == 200 process_update_response(res, ) else raise "HTTP Error #{json.status}: #{json.body}" end return self end |