Class: FbookGraph::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/fbook_graph/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(token) ⇒ Client

Constructor



7
8
9
# File 'lib/fbook_graph/client.rb', line 7

def initialize(token)
  @token = token
end

Instance Attribute Details

#tokenObject

Attributes



4
5
6
# File 'lib/fbook_graph/client.rb', line 4

def token
  @token
end

Instance Method Details

#my_friends(**search_options) ⇒ Object



21
22
23
24
25
26
27
28
# File 'lib/fbook_graph/client.rb', line 21

def my_friends(**search_options)
  options = {
    access_token: token,
    fields: 'friends'
  }

  Friend.all(search_options, options: options)
end

#my_images(*albums) ⇒ Object

Instance Methods



12
13
14
15
16
17
18
19
# File 'lib/fbook_graph/client.rb', line 12

def my_images(*albums)
  options = {
    access_token: token,
    fields: 'photos{album,images}'
  }

  Image.all(albums: albums, options: options)
end