Permalink
Browse files

add like.rb and like_spec.rb

  • Loading branch information...
1 parent a307a43 commit 5edf6a8852561d40f8839d07eaba6700bcdab4e6 @nov committed Apr 30, 2009
Showing with 22 additions and 0 deletions.
  1. +15 −0 lib/smartfm/model/like.rb
  2. +7 −0 spec/smartfm/model/like_spec.rb
View
@@ -0,0 +1,15 @@
+class Smartfm::Like < Smartfm::Base
+ ATTRIBUTES = [:id, :type, :title, :description, :href, :favorite, :user]
+ attr_reader *ATTRIBUTES
+
+ def initialize(params)
+ @id = params[:id]
+ @type = params[:user]
+ @title = params[:title]
+ @description = params[:description]
+ @href = params[:href]
+ @favorite = params[:favorite]
+ @user = self.deserialize(params[:user], :as => Smartfm::User)
+ end
+
+end
@@ -0,0 +1,7 @@
+require File.join(File.dirname(__FILE__), '..', '..', 'spec_helper')
+
+describe String do
+ it "should respond to length" do
+ "hoge".should respond_to(:length)
+ end
+end

0 comments on commit 5edf6a8

Please sign in to comment.