Class: MusicBrainz::Webservice::IWebservice

Inherits:
Object
  • Object
show all
Defined in:
lib/rbrainz/webservice/webservice.rb

Overview

An interface all concrete web service classes have to implement.

All web service classes have to implement this and follow the method specifications.

Direct Known Subclasses

Webservice

Instance Method Summary collapse

Instance Method Details

#get(entity_type, options = { :id=>nil, :include=>nil, :filter=>nil, :version=>1 }) ⇒ Object

Query the web service.

This method must be implemented by the concrete webservices and should return an IO object on success.

Options: [:id] A MBID if querying for a single ressource. [:include] An include object (see AbstractIncludes). [:filter] A filter object (see AbstractFilter). [:version] The version of the webservice to use. Defaults to 1.

Raises:

  • (NotImplementedError)


32
33
34
# File 'lib/rbrainz/webservice/webservice.rb', line 32

def get(entity_type, options={ :id=>nil, :include=>nil, :filter=>nil, :version=>1 })
  raise NotImplementedError.new('Called abstract method.')
end

#post(entity_type, options = { :id=>nil, :params=>[], :version=>1 }) ⇒ Object

Submit data to the web service.

This method must be implemented by the concrete webservices and should return an IO object on success.

Options: [:id] A MBID if querying for a single ressource. [:params] A Hash or Array containing the data to post as key/value pairs. [:version] The version of the webservice to use. Defaults to 1.

Raises:

  • (NotImplementedError)


45
46
47
# File 'lib/rbrainz/webservice/webservice.rb', line 45

def post(entity_type, options={ :id=>nil, :params=>[], :version=>1 })
  raise NotImplementedError.new('Called abstract method.')
end