class G5FacebookApiClient::Base

Public Class Methods

new(client_id, client_secret, page=nil) click to toggle source
# File lib/g5_facebook_api_client/base.rb, line 3
def initialize(client_id, client_secret, page=nil)
  @client_id = client_id
  @client_secret = client_secret
  @page = page
end

Public Instance Methods

access_token() click to toggle source
# File lib/g5_facebook_api_client/base.rb, line 9
def access_token
  @access_token ||=
    G5FacebookApiClient::AccessToken.new(@client_id, @client_secret).fetch
end
encode(string) click to toggle source
# File lib/g5_facebook_api_client/base.rb, line 26
def encode(string)
  URI::encode(string)
end
get(url) click to toggle source
# File lib/g5_facebook_api_client/base.rb, line 18
def get(url)
  HTTParty.get(encode(url)).body
end
parse(body) click to toggle source
# File lib/g5_facebook_api_client/base.rb, line 14
def parse(body)
  JSON.parse(body)
end
post(url) click to toggle source
# File lib/g5_facebook_api_client/base.rb, line 22
def post(url)
  HTTParty.post(encode(url)).body
end