Class: Traktr::Comment

Inherits:
Endpoint show all
Defined in:
lib/traktr/comment.rb

Instance Method Summary collapse

Methods inherited from Endpoint

#initialize

Constructor Details

This class inherits a constructor from Traktr::Endpoint

Instance Method Details

#episode(data) ⇒ Object



3
4
5
6
# File 'lib/traktr/comment.rb', line 3

def episode( data )
  data.merge!(@auth.merge({ review: data[:comment].split(/\s+/).length > 200 }))
  parse_response self.class.post('/' + File.join('episode', @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
end

#movie(data) ⇒ Object



8
9
10
11
# File 'lib/traktr/comment.rb', line 8

def movie( data )
  data.merge!(@auth.merge({ review: data[:comment].split(/\s+/).length > 200 }))
  parse_response self.class.post('/' + File.join('movie', @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
end

#show(data) ⇒ Object



13
14
15
16
# File 'lib/traktr/comment.rb', line 13

def show( data )
  data.merge!(@auth.merge({ review: data[:comment].split(/\s+/).length > 200 }))
  parse_response self.class.post('/' + File.join('show', @client.api_key), body: data.to_json, headers: { 'Content-Type' => 'application/json'})
end