Class: Mogli::Page

Inherits:
Profile show all
Defined in:
lib/mogli/page.rb

Defined Under Namespace

Classes: MissingAccessToken

Instance Attribute Summary

Attributes inherited from Model

#type

Attributes included from Model::Search

#search_type

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Profile

#image_url, #large_image_url, #small_image_url, #square_image_url, #to_s

Methods inherited from Model

#==, add_creation_method, #client, #client=, creation_keys, creation_properties, define_properties, #destroy, #fetch, find, has_association, hash_populating_accessor, included, #initialize, #merge!, #method_missing, #post_params, property, #warn_about_invalid_property

Methods included from Model::Search

#search

Constructor Details

This class inherits a constructor from Mogli::Model

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Mogli::Model

Class Method Details

.recognize?(hash) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/mogli/page.rb', line 29

def self.recognize?(hash)
  hash.has_key?("category")
end

Instance Method Details

#client_for_pageObject



22
23
24
25
26
27
# File 'lib/mogli/page.rb', line 22

def client_for_page
  if access_token.nil? || access_token.empty?
    raise MissingAccessToken.new("You can only get a client for this page if an access_token has been provided. i.e. via /me/accounts")
  end
  Client.new(access_token)
end