Module: Genius::Annotations
- Defined in:
- lib/genius/api/annotations.rb
Overview
An annotation is a piece of content about a part of a document. The document may be a song (hosted on Genius) or a web page (hosted anywhere). The part of a document that an annotation is attached to is called a referent.
Class Method Summary collapse
-
.annotations(id:, action:, token:, http_verb: 'get', options: {}) ⇒ Hash?
Data for a specific annotation.
Class Method Details
.annotations(id:, action:, token:, http_verb: 'get', options: {}) ⇒ Hash?
Data for a specific annotation. Supports GET, POST, PUT, DELETE verbs with optional voting actions.
17 18 19 20 21 22 23 24 |
# File 'lib/genius/api/annotations.rb', line 17 def annotations(id:, action:, token:, http_verb: 'get', options: {}) return if token.nil? && !Auth..nil? Errors.validate_token(token) unless token.nil? raise ArgumentError, 'only PUT accepts `action` param' if http_verb != 'put' && !action.nil? JSON.parse(request(id: id, action: action, token: token, http_verb: http_verb, options: ).body) end |