mirror of
https://github.com/nov/fb_graph2
synced 2023-03-27 23:22:15 -04:00
Merge pull request #125 from bryanbrunetti/fix-message-tags-format
Fix message tags format
This commit is contained in:
commit
a2dd44328e
3 changed files with 26 additions and 10 deletions
|
@ -24,9 +24,11 @@ module FbGraph2
|
||||||
def initialize(id, attributes = {})
|
def initialize(id, attributes = {})
|
||||||
super
|
super
|
||||||
if attributes.include? :message_tags
|
if attributes.include? :message_tags
|
||||||
self.message_tags = attributes[:message_tags].collect do |message_tag|
|
self.message_tags = attributes[:message_tags].values.collect do |message_tags|
|
||||||
TaggedProfile.new message_tag[:id], message_tag
|
message_tags.collect do |tag|
|
||||||
|
TaggedProfile.new tag[:id], tag
|
||||||
end
|
end
|
||||||
|
end.flatten
|
||||||
end
|
end
|
||||||
if attributes.include? :privacy
|
if attributes.include? :privacy
|
||||||
self.privacy = Struct::Privacy.new attributes[:privacy]
|
self.privacy = Struct::Privacy.new attributes[:privacy]
|
||||||
|
|
|
@ -12,6 +12,7 @@ describe FbGraph2::Edge::Posts do
|
||||||
posts.should_not be_blank
|
posts.should_not be_blank
|
||||||
posts.each do |post|
|
posts.each do |post|
|
||||||
post.should be_instance_of FbGraph2::Post
|
post.should be_instance_of FbGraph2::Post
|
||||||
|
post.message_tags.count.should == 2
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -12,13 +12,26 @@
|
||||||
}]
|
}]
|
||||||
},
|
},
|
||||||
"message": "Nov Matake test",
|
"message": "Nov Matake test",
|
||||||
"message_tags": [{
|
"message_tags": {
|
||||||
|
"0": [
|
||||||
|
{
|
||||||
"id": "579612276",
|
"id": "579612276",
|
||||||
"name": "Nov Matake",
|
"name": "Nov Matake",
|
||||||
"type": "user",
|
"type": "user",
|
||||||
"offset": 0,
|
"offset": 0,
|
||||||
"length": 10
|
"length": 10
|
||||||
}],
|
}
|
||||||
|
],
|
||||||
|
"11": [
|
||||||
|
{
|
||||||
|
"id": "10153177366617368",
|
||||||
|
"name": "Bryan Brunetti",
|
||||||
|
"type": "user",
|
||||||
|
"offset": 11,
|
||||||
|
"length": 14
|
||||||
|
}
|
||||||
|
]
|
||||||
|
},
|
||||||
"actions": [{
|
"actions": [{
|
||||||
"name": "Comment",
|
"name": "Comment",
|
||||||
"link": "https://www.facebook.com/579612276/posts/10152483324277277"
|
"link": "https://www.facebook.com/579612276/posts/10152483324277277"
|
||||||
|
|
Loading…
Reference in a new issue