class WordpRSS::Request

Attributes

url[R]

Public Class Methods

new(url) click to toggle source
# File lib/wordprss/request.rb, line 6
def initialize(url)
  @url = url
end

Public Instance Methods

call() click to toggle source

Performs the request to the given URL in order to get the RSS feed contents

@return [RestClient::Response]

# File lib/wordprss/request.rb, line 13
def call
  fail(WordpRSS::InvalidURLError.new("#{url} is not a valid URL")) unless url =~ URI::regexp

  RestClient.get(url)
end