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:
parent
27bd269bdb
commit
eea774a1a4
3 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue