Module: Genius::Referents
- Defined in:
- lib/genius/api/referents.rb
Overview
Referents are the sections of a piece of content to which annotations are attached. Each referent is associated with a web page or a song and may have one or more annotations. Referents can be searched by the document they are attached to or by the user that created them. When a new annotation is created either a referent is created with it or that annotation is attached to an existing referent.
Constant Summary collapse
Class Method Summary collapse
-
.referents(token: nil, options: {}) ⇒ Hash
Genius::Referents.referents
-> Hash.
Class Method Details
.referents(token: nil, options: {}) ⇒ Hash
Genius::Referents.referents
-> Hash
Referents by content item or user responsible for an included annotation. You may pass only one of song_id and web_page_id, not both.
37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/genius/api/referents.rb', line 37 def referents(token: nil, options: {}) return if token.nil? && !Auth..nil? Errors.validate_token(token) unless token.nil? if .key?(:web_page) && .key?(:song_id) raise ArgumentError, "You may pass only one of song_id and web_page_id, not both!" end params = (, %i[created_by_id text_format per_page page]) response = HTTParty.get("#{ENDPOINT}?access_token=#{token_ext(token)}#{params}").body JSON.parse(response) end |