class OmdbGateway::MovieRequest

Attributes

id[R]
title[R]

Public Class Methods

new(params) click to toggle source
Calls superclass method
# File lib/omdb_gateway/movie_request.rb, line 6
def initialize(params)
  @id = params[:id]
  @title = params[:title]
  super
end

Public Instance Methods

fetch() click to toggle source
Calls superclass method
# File lib/omdb_gateway/movie_request.rb, line 12
def fetch
  super(Response)
end

Private Instance Methods

url() click to toggle source
Calls superclass method
# File lib/omdb_gateway/movie_request.rb, line 18
def url
  raise InvalidIMDBParams.new('IMDB ID/Title not present') if !@id.present? && !@title.present?
  url_string = super
  url_string += @id.present? ? "&i=#{@id}" : "&t=#{@title}"

  url_string
end