Sha256: 65fff45eae06d9ce478af8d5fc73201495e1e726e7c499d778764300d7ef862e

Contents?: true

Size: 1.05 KB

Versions: 1

Compression:

Stored size: 1.05 KB

Contents

module Okezoneid
	module SSOComment
		include SSOOkezone
		mattr_accessor :api_comment_path

		self.api_comment_path = '/api/v1/comments/'

		def sso_post_comment(params)
			comment = {:body =>  {:content_id => params['content_id'],
														:okezone_id => params['okezone_id'],
														:channel_id => params['channel_id'],
														:title => params['title'],
														:date_created => params['date_created'],
														:from_name => params['from_name'],
														:request_url => params['request_url'],
														:comment => params['comment'],
														:parent_id => params['parent_id'],
														:source => params['source']}}
			

			token = sso_get_token
			response = token.post(api_comment_path, comment)
			return response.body
		end

		def sso_get_comment(params)
			comment = {:body =>  {:content_id => params['content_id'],
														:offset => params['offset'],
														:limit => params['limit']}}

			token = sso_get_token
			response = token.get(api_comment_path, comment)
			return response.body
		end

	end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
okezoneid-0.0.1 lib/okezoneid/sso_comment.rb