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

there are people who want to use FbGraph2::Node without any object type detection..

close #21
This commit is contained in:
nov 2014-12-04 22:56:55 +09:00
parent 27bd269bdb
commit eea774a1a4
3 changed files with 2 additions and 2 deletions

View file

@ -16,7 +16,6 @@ module FbGraph2
end
def assign(attributes)
self.raw_attributes = attributes
Array(self.class.registered_attributes).each do |type, keys|
keys.each do |key|
if attributes.include? key

View file

@ -9,6 +9,7 @@ module FbGraph2
def initialize(id, attributes = {})
self.id = id
self.raw_attributes = attributes
assign attributes if respond_to? :assign
authenticate attributes[:access_token] if attributes.include? :access_token
end

View file

@ -70,7 +70,7 @@ describe FbGraph2::Node do
describe '#initialize' do
its(:id) { should == 'identifier' }
its(:access_token) { should be_nil }
its(:raw_attributes) { should be_nil }
its(:raw_attributes) { should == {} }
end
describe '#authenticate' do