Class: TMDBParty::Video

Inherits:
Object
  • Object
show all
Defined in:
lib/tmdb_party/video.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ Video

Returns a new instance of Video.



5
6
7
# File 'lib/tmdb_party/video.rb', line 5

def initialize(url)
  @url = url
end

Instance Attribute Details

#urlObject (readonly)

Returns the value of attribute url.



3
4
5
# File 'lib/tmdb_party/video.rb', line 3

def url
  @url
end

Class Method Details

.parse(data) ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/tmdb_party/video.rb', line 9

def self.parse(data)
  return unless data
  if data.is_a?(Array)
    data.collect do |url|
      Video.new(url)
    end
  else
    Video.new(data)
  end
end