class RMD::Zing::Song

Public Instance Methods

fetch() click to toggle source
# File lib/rmd/zing/song.rb, line 8
def fetch
  if new_link
    @data_link = RMD::Zing::Utils::CorrectUrl.correct(new_link)
  else
    @errors = 'Can not get song from this link!'
  end
end

Private Instance Methods

agent() click to toggle source
# File lib/rmd/zing/song.rb, line 18
def agent
  @agent ||= Mechanize.new
end
page() click to toggle source
# File lib/rmd/zing/song.rb, line 22
def page
  @page ||= agent.get(link)
end
regex() click to toggle source
# File lib/rmd/zing/song.rb, line 26
def regex
  /http\:\/\/mp3.zing.vn\/download\/song\/\S+\/\w+/
end