Class: Musicz::Search::RecordingRepository

Inherits:
Repository
  • Object
show all
Defined in:
lib/musicz/search/recording_repository.rb

Constant Summary collapse

ENDPOINT =
"recording"

Instance Method Summary collapse

Methods inherited from Repository

#initialize

Constructor Details

This class inherits a constructor from Musicz::Search::Repository

Instance Method Details

#by_id(id_options) ⇒ Object

Parameters:



13
14
15
# File 'lib/musicz/search/recording_repository.rb', line 13

def by_id(id_options)
  by_id_with_entity(id_options, ENDPOINT, Musicz::Entities::Recording)
end

#by_query(query_terms) ⇒ Object

This executes a generic query against the MusicBrainz API No support for paging, so use decently specific queries



27
28
29
30
31
32
33
# File 'lib/musicz/search/recording_repository.rb', line 27

def by_query(query_terms)
  by_query_with_entity(
    query_terms,
    ENDPOINT,
    Musicz::Entities::RecordingList
  )
end

#by_term(term) ⇒ Object

This gets executed on the MusicBrainz server by querying the recording, sortname and alias fields

Parameters:

  • term (String)

    The general term to searh MusicBrainz for



20
21
22
# File 'lib/musicz/search/recording_repository.rb', line 20

def by_term(term)
  by_term_with_entity(term, ENDPOINT, Musicz::Entities::RecordingList)
end