mirror of
https://github.com/nov/fb_graph2
synced 2023-03-27 23:22:15 -04:00
rename FbGraph2::Application to FbGraph2::App
This commit is contained in:
parent
5fc65e5d01
commit
6b6fb17034
11 changed files with 28 additions and 10 deletions
|
@ -6,7 +6,7 @@ module FbGraph2
|
|||
register_attributes(
|
||||
raw: [:type, :no_feed_story],
|
||||
time: [:publish_time],
|
||||
application: [:application],
|
||||
app: [:application],
|
||||
user: [:from],
|
||||
custom: [:data]
|
||||
)
|
||||
|
|
11
lib/fb_graph2/achievement_type.rb
Normal file
11
lib/fb_graph2/achievement_type.rb
Normal file
|
@ -0,0 +1,11 @@
|
|||
module FbGraph2
|
||||
class AchievementType < Node
|
||||
register_attributes(
|
||||
raw: [:type, :title, :url, :description, :is_scraped],
|
||||
time: [:updated_time, :created_time],
|
||||
picture: [:image],
|
||||
app: [:application],
|
||||
custom: [:data, :context]
|
||||
)
|
||||
end
|
||||
end
|
|
@ -1,5 +1,5 @@
|
|||
module FbGraph2
|
||||
class Application < Node
|
||||
class App < Node
|
||||
register_attributes(
|
||||
raw: [
|
||||
:id, :android_key_hash, :app_domains, :auth_dialog_data_help_url, :auth_dialog_headline,
|
0
lib/fb_graph2/app_link_host.rb
Normal file
0
lib/fb_graph2/app_link_host.rb
Normal file
|
@ -36,8 +36,8 @@ module FbGraph2
|
|||
end
|
||||
when :album
|
||||
Album.new raw[:id], raw
|
||||
when :application
|
||||
Application.new raw[:id], raw
|
||||
when :app
|
||||
App.new raw[:id], raw
|
||||
when :comment
|
||||
Comment.new raw[:id], raw
|
||||
when :group
|
||||
|
@ -78,7 +78,7 @@ module FbGraph2
|
|||
|
||||
def as_profile(raw)
|
||||
klass = if raw.include?(:namespace)
|
||||
Application
|
||||
App
|
||||
elsif raw.include?(:category)
|
||||
Page
|
||||
else
|
||||
|
|
7
lib/fb_graph2/domain.rb
Normal file
7
lib/fb_graph2/domain.rb
Normal file
|
@ -0,0 +1,7 @@
|
|||
module FbGraph2
|
||||
class Domain < Node
|
||||
register_attributes(
|
||||
raw: [:name]
|
||||
)
|
||||
end
|
||||
end
|
|
@ -5,7 +5,7 @@ module FbGraph2
|
|||
time: [:created_time, :updated_time],
|
||||
profile: [:from],
|
||||
user: [:to],
|
||||
application: [:application],
|
||||
app: [:application],
|
||||
custom: [:object]
|
||||
)
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ module FbGraph2
|
|||
:source, :story
|
||||
],
|
||||
time: [:created_time, :updated_time],
|
||||
application: [:application],
|
||||
app: [:application],
|
||||
page: [:place],
|
||||
profile: [:from],
|
||||
profiles: [:to, :with_tags],
|
||||
|
|
|
@ -4,7 +4,7 @@ module FbGraph2
|
|||
register_attributes(
|
||||
raw: [:score],
|
||||
user: [:user],
|
||||
application: [:application]
|
||||
app: [:application]
|
||||
)
|
||||
end
|
||||
end
|
||||
|
|
|
@ -2,7 +2,7 @@ require 'spec_helper'
|
|||
|
||||
describe FbGraph2::User do
|
||||
describe '.app' do
|
||||
let(:klass) { FbGraph2::Application }
|
||||
let(:klass) { FbGraph2::App }
|
||||
|
||||
it 'should not call API' do
|
||||
expect do
|
||||
|
@ -13,7 +13,7 @@ describe FbGraph2::User do
|
|||
|
||||
context 'when fetched' do
|
||||
it 'should call API' do
|
||||
app = mock_graph :get, 'app', 'application/app' do
|
||||
app = mock_graph :get, 'app', 'app/app' do
|
||||
klass.app('token').fetch
|
||||
end
|
||||
app.should be_instance_of klass
|
||||
|
|
Loading…
Reference in a new issue