<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array">
    <added>
      <filename>test/fixtures/object/bookmark.xml</filename>
    </added>
  </added>
  <modified type="array">
    <modified>
      <diff>@@ -13,7 +13,8 @@ require 'gluestick/object'
 module Gluestick
   class &lt;&lt; self
     extend Forwardable
-    def_delegators :client, :login
+    attr_reader     :username
+    def_delegators  :client, :login, :logout, :username
 
     def client
       @client = Gluestick::Client.instance unless @client</diff>
      <filename>lib/gluestick.rb</filename>
    </modified>
    <modified>
      <diff>@@ -7,6 +7,8 @@ module Gluestick
     base_uri  API_URI
     format    :xml
 
+    attr_reader :username
+
     def login(username, password)
       basic_auth  = { :username =&gt; username, :password =&gt; password }
       response    = unauthenticated_get(&quot;/user/validate&quot;, :basic_auth =&gt; basic_auth)</diff>
      <filename>lib/gluestick/client.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,9 +1,12 @@
 module Gluestick
   class Object
     extend LazyLoader
-  
-    private_class_method  :new
-    attr_reader           :objectKey, :title, :image, :link, :type    
+    attr_reader :objectKey
+    lazy_load   [:title, :image, :link, :type], :get
+
+    def initialize(objectKey)
+      @objectKey = objectKey
+    end
 
     def self.get(objectId)
       begin
@@ -18,15 +21,18 @@ module Gluestick
       raise TypeError if not response.instance_of?(Gluestick::AdaptiveBlueResponse)
 
       object_xml  = response.response['object']
-      object      = create_for_type(object_xml['type'])
+      type        = object_xml['type']
+      objectKey   = object_xml['objectKey']
+      object      = create_for_type(objectKey, type)
 
       assign_variables_from_response(object, response)
       object
     end
 
     def self.from_interaction(response)
+      objectKey   = response['objectKey']
       type        = response['category']
-      object      = create_for_type(type)
+      object      = create_for_type(objectKey, type)
 
       %w[title image objectKey].each do |property|
         object.instance_variable_set(&quot;@#{property}&quot;, response[property])  
@@ -53,33 +59,34 @@ module Gluestick
       response.response['links']['link']
     end
 
-    protected
-
-    def self.create
-      new
+    def glue_object?
+      false
     end
 
-    def self.create_for_type(type)
+    protected
+
+    def self.create_for_type(objectKey, type)
       # Would've extracted this out into a constant, but the classes
       # are not defined and throws NameErrors
 	    @@categories = {
-	      :books               =&gt; Gluestick::BookObject,
-	      :electronics         =&gt; Gluestick::ElectronicObject,
-	      :movie_stars         =&gt; Gluestick::MovieStarObject,
-	      :movies              =&gt; Gluestick::MovieObject,
-	      :music               =&gt; Gluestick::MusicObject,
-	      :recording_artists   =&gt; Gluestick::RecordingArtistObject,
-	      :restaurants         =&gt; Gluestick::RestaurantObject,
-	      :stocks              =&gt; Gluestick::StockObject,
-	      :tv_shows            =&gt; Gluestick::TVShowObject,
-	      :video_games         =&gt; Gluestick::VideoGameObject,
-	      :wines               =&gt; Gluestick::WineObject
+	      :books              =&gt; Gluestick::BookObject,
+	      :electronics        =&gt; Gluestick::ElectronicObject,
+	      :movie_stars        =&gt; Gluestick::MovieStarObject,
+	      :movies             =&gt; Gluestick::MovieObject,
+	      :music              =&gt; Gluestick::MusicObject,
+	      :recording_artists  =&gt; Gluestick::RecordingArtistObject,
+	      :restaurants        =&gt; Gluestick::RestaurantObject,
+	      :stocks             =&gt; Gluestick::StockObject,
+	      :tv_shows           =&gt; Gluestick::TVShowObject,
+	      :video_games        =&gt; Gluestick::VideoGameObject,
+	      :wines              =&gt; Gluestick::WineObject,
+        :bookmarks          =&gt; Gluestick::BookmarkObject
 	    }
       
       if @@categories.has_key?(type.to_sym)
-        @@categories[type.to_sym].create
+        @@categories[type.to_sym].new(objectKey)
       else
-        create
+        new(objectKey)
       end
     end
 
@@ -90,39 +97,45 @@ module Gluestick
     end
   end
 
-  class BookObject &lt; Object
+  class GlueObject &lt; Object
+    def glue_object?; true; end
+  end
+
+  class BookObject &lt; GlueObject
   end
 
-  class ElectronicObject &lt; Object
+  class ElectronicObject &lt; GlueObject
   end
 
-  class MovieStarObject &lt; Object
+  class MovieStarObject &lt; GlueObject
   end
 
-  class MovieObject &lt; Object
+  class MovieObject &lt; GlueObject
     lazy_load [:director, :year, :starring], :get
   end
 
-  class MusicObject &lt; Object
+  class MusicObject &lt; GlueObject
   end
 
-  class RecordingArtistObject &lt; Object
+  class RecordingArtistObject &lt; GlueObject
   end
 
-  class RestaurantObject &lt; Object
+  class RestaurantObject &lt; GlueObject
   end
 
-  class StockObject &lt; Object
+  class StockObject &lt; GlueObject
   end
 
-  class TVShowObject &lt; Object
+  class TVShowObject &lt; GlueObject
   end
 
-  class VideoGameObject &lt; Object
+  class VideoGameObject &lt; GlueObject
   end
 
-  class WineObject &lt; Object
+  class WineObject &lt; GlueObject
   end
 
+  class BookmarkObject &lt; Object
+  end
 
 end</diff>
      <filename>lib/gluestick/object.rb</filename>
    </modified>
    <modified>
      <diff>@@ -9,8 +9,51 @@ class ObjectTest &lt; Test::Unit::TestCase
     Gluestick::Object.from_object(response)
   end
 
-  should &quot;not be able to instantiate an interaction&quot; do
+  should &quot;not be able to instantiate without objectKey&quot; do
     lambda { Gluestick::Object.new }.should raise_error
+
+    object = Gluestick::Object.new(&quot;movies/slumdog_millionaire/danny_boyle&quot;)
+    object.should be_instance_of(Gluestick::Object)
+  end
+
+  context &quot;object instantiated&quot; do
+    context &quot;with a valid key&quot; do
+      setup do
+        stub_get(&quot;/object/users?objectId=movies%2Fslumdog_millionaire%2Fdanny_boyle&quot;, &quot;object/get.xml&quot;)
+        @object = Gluestick::Object.get(&quot;movies/slumdog_millionaire/danny_boyle&quot;)
+      end
+
+      should &quot;be a glue object&quot; do
+        @object.should be_glue_object
+        @object.should be_instance_of(Gluestick::MovieObject)
+      end
+    end
+
+    context &quot;with a bad key&quot; do
+      setup do
+        stub_get(&quot;/object/get?objectId=blah&quot;, &quot;errors/invalid_object.xml&quot;)
+        @object = Gluestick::Object.new(&quot;blah&quot;)
+      end
+      
+      should &quot;throw an invalid object error when getting a lazy loaded attribute&quot; do
+        lambda { @object.title }.should raise_error(Gluestick::InvalidObject)
+      end
+    end
+
+    context &quot;with a URL not Glue Object&quot; do
+      setup do
+        stub_get(&quot;/object/get?objectId=http%3A%2F%2Fwww.cnn.com%2F&quot;, &quot;object/bookmark.xml&quot;)
+        @object = Gluestick::Object.get(&quot;http://www.cnn.com/&quot;)
+      end
+
+      should &quot;be a bookmark object&quot; do
+        @object.should be_instance_of(Gluestick::BookmarkObject)
+      end
+
+      should &quot;not be a glue object&quot; do
+        @object.should_not be_glue_object
+      end
+    end
   end
 
   should &quot;be able to generate objects from factories&quot; do</diff>
      <filename>test/gluestick/object_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -2,9 +2,12 @@ require 'test_helper'
 
 class GluestickTest &lt; Test::Unit::TestCase
 
+should &quot;respond to client attributes&quot; do
+  Gluestick.should respond_to(:client, :login, :username)
+end
+
 context &quot;client&quot; do
   should &quot;have a client&quot; do
-    Gluestick.should respond_to(:client)
     Gluestick.client.should_not be_nil
   end
 
@@ -13,9 +16,30 @@ context &quot;client&quot; do
   end
 end
 
-context &quot;login&quot; do
-  should &quot;respond to login&quot; do
-    Gluestick.should respond_to(:login)
+context &quot;username&quot; do
+  context &quot;logged in&quot; do
+    setup do
+      stub_login
+    end
+
+    should &quot;have a username&quot; do
+      Gluestick.username.should_not be_nil
+      Gluestick.username.should == &quot;username&quot;
+    end
+  end
+
+  context &quot;not logged in&quot; do
+    setup do
+      Gluestick.logout if Gluestick.logged_in?
+    end
+
+    teardown do
+      stub_login if not Gluestick.logged_in?
+    end
+
+    should &quot;not have a username&quot; do
+      Gluestick.username.should be_nil
+    end
   end
 end
 </diff>
      <filename>test/gluestick_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>a992121536e7eb32ce305ad697cf41ef196e6ddf</id>
    </parent>
  </parents>
  <author>
    <name>bdotdub</name>
    <email>bdotdub@gmail.com</email>
  </author>
  <url>http://github.com/bdotdub/gluby/commit/01c943ad9a0ecc4839a8797a230f38624a8adb3e</url>
  <id>01c943ad9a0ecc4839a8797a230f38624a8adb3e</id>
  <committed-date>2009-05-30T14:20:55-07:00</committed-date>
  <authored-date>2009-05-30T14:20:55-07:00</authored-date>
  <message>added bookmark objects for urls that aren't glue objects. added Object.new, though I'm not sure I'm happy with it. added logout and username accessor for Gluestick</message>
  <tree>bea5366ae9baabb595f43df97561bca634518011</tree>
  <committer>
    <name>bdotdub</name>
    <email>bdotdub@gmail.com</email>
  </committer>
</commit>
