Class: VimeoRuby::Video
Instance Attribute Summary collapse
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#duration ⇒ Object
readonly
Returns the value of attribute duration.
-
#embed_html ⇒ Object
readonly
Returns the value of attribute embed_html.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#player_embed_url ⇒ Object
readonly
Returns the value of attribute player_embed_url.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Attributes inherited from Base
#access_token, #additional_info, #vimeo_id
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(attrs: {}, user_class: VimeoRuby::User) ⇒ Video
constructor
A new instance of Video.
Methods inherited from Base
base_uri, client_identifier, client_secret, get
Constructor Details
#initialize(attrs: {}, user_class: VimeoRuby::User) ⇒ Video
Returns a new instance of Video.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/vimeo_ruby/video.rb', line 5 def initialize(attrs: {}, user_class: VimeoRuby::User) @description = attrs.delete("description") @duration = attrs.delete("duration") @embed_html = attrs.delete("embed").delete("html") @link = attrs.delete("link") @name = attrs.delete("name") @player_embed_url = attrs.delete("player_embed_url") @type = attrs.delete("type") @user = user_class.new(attrs: attrs.delete("user")) vimeo_uri_with_id = attrs.delete("uri") super(vimeo_id: vimeo_uri_with_id, remaining_attrs: attrs) end |
Instance Attribute Details
#description ⇒ Object (readonly)
Returns the value of attribute description.
3 4 5 |
# File 'lib/vimeo_ruby/video.rb', line 3 def description @description end |
#duration ⇒ Object (readonly)
Returns the value of attribute duration.
3 4 5 |
# File 'lib/vimeo_ruby/video.rb', line 3 def duration @duration end |
#embed_html ⇒ Object (readonly)
Returns the value of attribute embed_html.
3 4 5 |
# File 'lib/vimeo_ruby/video.rb', line 3 def @embed_html end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
3 4 5 |
# File 'lib/vimeo_ruby/video.rb', line 3 def link @link end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/vimeo_ruby/video.rb', line 3 def name @name end |
#player_embed_url ⇒ Object (readonly)
Returns the value of attribute player_embed_url.
3 4 5 |
# File 'lib/vimeo_ruby/video.rb', line 3 def @player_embed_url end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/vimeo_ruby/video.rb', line 3 def type @type end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
3 4 5 |
# File 'lib/vimeo_ruby/video.rb', line 3 def user @user end |
Class Method Details
.get_video(video_id) ⇒ Object
19 20 21 22 |
# File 'lib/vimeo_ruby/video.rb', line 19 def get_video(video_id) video_info = get("#{base_uri}/videos/#{video_id}") new(attrs: video_info) end |