Class: SocialNet::Instagram::Models::Video
- Inherits:
-
Object
- Object
- SocialNet::Instagram::Models::Video
- Defined in:
- lib/social_net/instagram/models/video.rb
Instance Attribute Summary collapse
-
#caption ⇒ Object
readonly
Returns the value of attribute caption.
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#link ⇒ Object
readonly
Returns the value of attribute link.
-
#thumbnail_url ⇒ Object
readonly
Returns the value of attribute thumbnail_url.
-
#video_url ⇒ Object
readonly
Returns the value of attribute video_url.
Class Method Summary collapse
-
.find_by(params = {}) ⇒ SocialNet::Instagram::Models::Video?
Returns the existing Instagram video matching the provided attributes or nil when the video is not found.
-
.find_by!(params = {}) ⇒ SocialNet::Instagram::Models::Video?
Returns the existing Instagram video matching the provided attributes or raises an error when the video is not found.
Instance Method Summary collapse
-
#initialize(attrs = {}) ⇒ Video
constructor
A new instance of Video.
Constructor Details
#initialize(attrs = {}) ⇒ Video
Returns a new instance of Video.
11 12 13 14 15 16 17 |
# File 'lib/social_net/instagram/models/video.rb', line 11 def initialize(attrs = {}) @id = attrs['id'] @video_url = attrs['video_url'] @thumbnail_url = attrs['thumbnail_url'] @link = attrs['link'] @caption = attrs['caption'] if attrs['caption'] end |
Instance Attribute Details
#caption ⇒ Object (readonly)
Returns the value of attribute caption.
9 10 11 |
# File 'lib/social_net/instagram/models/video.rb', line 9 def @caption end |
#id ⇒ Object (readonly)
Returns the value of attribute id.
9 10 11 |
# File 'lib/social_net/instagram/models/video.rb', line 9 def id @id end |
#link ⇒ Object (readonly)
Returns the value of attribute link.
9 10 11 |
# File 'lib/social_net/instagram/models/video.rb', line 9 def link @link end |
#thumbnail_url ⇒ Object (readonly)
Returns the value of attribute thumbnail_url.
9 10 11 |
# File 'lib/social_net/instagram/models/video.rb', line 9 def thumbnail_url @thumbnail_url end |
#video_url ⇒ Object (readonly)
Returns the value of attribute video_url.
9 10 11 |
# File 'lib/social_net/instagram/models/video.rb', line 9 def video_url @video_url end |
Class Method Details
.find_by(params = {}) ⇒ SocialNet::Instagram::Models::Video?
Returns the existing Instagram video matching the provided attributes or nil when the video is not found.
26 27 28 29 30 |
# File 'lib/social_net/instagram/models/video.rb', line 26 def self.find_by(params = {}) find_by! params rescue Errors::UnknownVideo nil end |
.find_by!(params = {}) ⇒ SocialNet::Instagram::Models::Video?
Returns the existing Instagram video matching the provided attributes or raises an error when the video is not found.
40 41 42 43 44 |
# File 'lib/social_net/instagram/models/video.rb', line 40 def self.find_by!(params = {}) if params[:shortcode] find_by_shortcode! params[:shortcode] end end |