Class: RMD::NCT::Getter::KeyFromUrl

Inherits:
Base
  • Object
show all
Defined in:
lib/rmd/nct/getter/key_from_url.rb

Constant Summary collapse

ROOT_URL =
'http://www.nhaccuatui.com/download/song'

Instance Attribute Summary

Attributes inherited from Base

#data_link, #errors, #url

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from RMD::NCT::Getter::Base

Instance Method Details

#fetchObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/rmd/nct/getter/key_from_url.rb', line 9

def fetch
  if key
    if response['error_message'] == 'Success'
      @data_link = response['data']['stream_url']
    else
      @errors = "#{response['error_message']}: #{new_link}"
    end
  else
    @errors = "The url does not contain the key."
  end
end