Class: InfomemeClient::MemeApplication

Inherits:
Object
  • Object
show all
Includes:
Communication
Defined in:
lib/infomeme_client/meme_application.rb

Instance Method Summary collapse

Methods included from Communication

#extract_from_response, #extract_or_response, #get, #handle_response, #post, #put, #request

Constructor Details

#initialize(options = {}) ⇒ MemeApplication

Returns a new instance of MemeApplication.



2
3
4
5
# File 'lib/infomeme_client/meme_application.rb', line 2

def initialize(options = {})
  self.consumer = OAuth::Consumer.new(options[:api_key] || ::INFOMEME_API_KEY, options[:api_secret] || ::INFOMEME_API_SECRET, :site => options[:site] || ::INFOMEME_API_SITE)
  self.token = OAuth::AccessToken.new(consumer)
end

Instance Method Details

#update_meme(meme_id, description, has_upload = true) ⇒ Object



11
12
13
# File 'lib/infomeme_client/meme_application.rb', line 11

def update_meme(meme_id, description, has_upload = true)
  handle_response :put, "/meme_app/memes/#{meme_id}", {:description => description, :has_upload => has_upload}
end

#verify_access(access_type, meme_id, oauth_token, oauth_nonce, oauth_timestamp, oauth_signature) ⇒ Object



7
8
9
# File 'lib/infomeme_client/meme_application.rb', line 7

def verify_access(access_type, meme_id, oauth_token, oauth_nonce, oauth_timestamp, oauth_signature)
  handle_response :post, "/meme_app/verify_access", {:access_type => access_type, :meme_id => meme_id, :verify_token => oauth_token, :verify_nonce => oauth_nonce, :verify_timestamp => oauth_timestamp, :verify_signature => oauth_signature}
end