class FbGraph2::TokenMetadata

Public Class Methods

new(attributes = {}) click to toggle source
Calls superclass method FbGraph2::Node::new
# File lib/fb_graph2/token_metadata.rb, line 11
def initialize(attributes = {})
  super :debug_token, attributes
  if app_id
    self.app = App.new app_id
  end
  if user_id
    self.user = User.new user_id
  end
  if profile_id
    self.page = Page.new profile_id
  end
end

Public Instance Methods

app_token?() click to toggle source
# File lib/fb_graph2/token_metadata.rb, line 33
def app_token?
  app.present? && user.blank? && page.blank?
end
fetch(params = {}, options = {}) click to toggle source
# File lib/fb_graph2/token_metadata.rb, line 24
def fetch(params = {}, options = {})
  attributes = get params, options
  self.class.new(attributes[:data]).authenticate access_token
end
page_token?() click to toggle source
# File lib/fb_graph2/token_metadata.rb, line 41
def page_token?
  app.present? && user.present? && page.present?
end
user_token?() click to toggle source
# File lib/fb_graph2/token_metadata.rb, line 37
def user_token?
  app.present? && user.present? && page.blank?
end
valid?() click to toggle source
# File lib/fb_graph2/token_metadata.rb, line 29
def valid?
  !!is_valid
end