Class: Hooloo::Video

Inherits:
MozartHash show all
Defined in:
lib/hooloo/video.rb

Instance Method Summary collapse

Methods inherited from MozartHash

bool, cast, date, field_mapping, #inspect, #method_missing, #respond_to?

Constructor Details

#initialize(id) ⇒ Video

Returns a new instance of Video.

Parameters:

  • id (Fixnum)


3
4
5
6
7
8
# File 'lib/hooloo/video.rb', line 3

def initialize(id)
  super
  if id.is_a? Fixnum
    @obj = Hooloo.request("videos/#{id}")['data'][0]['video']
  end
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Hooloo::MozartHash

Instance Method Details



9
10
11
# File 'lib/hooloo/video.rb', line 9

def copyright
  @obj['copyright'].split(',').map(&:strip)
end