Skip to content

Commit

Permalink
add like.rb and like_spec.rb
Browse files Browse the repository at this point in the history
  • Loading branch information
nov committed Apr 30, 2009
1 parent a307a43 commit 5edf6a8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
15 changes: 15 additions & 0 deletions lib/smartfm/model/like.rb
@@ -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
7 changes: 7 additions & 0 deletions spec/smartfm/model/like_spec.rb
@@ -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.