Class: Youtube

Inherits:
EDI::Service show all
Defined in:
lib/edi/services/youtube.rb

Instance Attribute Summary

Attributes inherited from EDI::Service

#message, #response

Instance Method Summary collapse

Methods inherited from EDI::Service

#initialize, #method_missing

Methods included from EDI::Environment

included, #validate_environment

Methods included from EDI::DSL

included

Constructor Details

This class inherits a constructor from EDI::Service

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class EDI::Service

Instance Method Details

#runObject



7
8
9
10
11
12
13
14
# File 'lib/edi/services/youtube.rb', line 7

def run
  response = EDI.get("#{url}?#{params}")
  if response.ok?
    "https://youtu.be/#{response.response["items"].first["id"]["videoId"]}"
  else
    EDI::Logger.debug response.response
  end
end