1
0
Fork 0
mirror of https://github.com/nov/fb_graph2 synced 2023-03-27 23:22:15 -04:00

basic user edges done

This commit is contained in:
nov 2014-05-28 14:31:58 +09:00
parent 1fd1825e03
commit c5d529be13
7 changed files with 76 additions and 0 deletions

View file

@ -0,0 +1,12 @@
module FbGraph2
class Edge
module Pokes
def pokes(params = {})
pokes = self.edge :pokes, params
pokes.collect do |poke|
Struct::Poke.new poke
end
end
end
end
end

View file

@ -0,0 +1,12 @@
module FbGraph2
class Edge
module Scores
def scores(params = {})
scores = self.edge :scores, params
scores.collect do |score|
Struct::Score.new score
end
end
end
end
end

View file

@ -0,0 +1,18 @@
module FbGraph2
class Edge
module Videos
def videos(*args)
params = args.extract_options!
videos = self.edge :videos, params, edge_scope: args.first
videos.collect do |video|
Video.new(video[:id], video).authenticate self.access_token
end
end
def video!(params = {})
video = post params, edge: :videos
Video.new(video[:id], params.merge(video)).authenticate self.access_token
end
end
end
end

View file

@ -0,0 +1,10 @@
module FbGraph2
class Struct
class Poke < Struct
register_attributes(
time: [:created_time],
user: [:from, :to]
)
end
end
end

View file

@ -0,0 +1,11 @@
module FbGraph2
class Struct
class Poke < Struct
register_attributes(
raw: [:score],
user: [:user],
application: [:application]
)
end
end
end

View file

@ -22,10 +22,13 @@ module FbGraph2
include Edge::Permissions
include Edge::Picture
include Edge::Photos
include Edge::Pokes
include Edge::Posts
include Edge::Scores
include Edge::Statuses
include Edge::Tagged
include Edge::Television
include Edge::Videos
register_attributes(
raw: [

10
lib/fb_graph2/video.rb Normal file
View file

@ -0,0 +1,10 @@
module FbGraph2
class Video < Node
register_attributes(
raw: [:description, :embed_html, :icon, :length, :name, :picture, :source],
time: [:created_time, :updated_time],
profile: [:from],
custom: [:format, :thumbnails]
)
end
end