Skip to content

Instantly share code, notes, and snippets.

@adriand adriand/Person.rb
Created Mar 15, 2010

Embed
What would you like to do?
# sure, 'class Tweep' would work too, but no way in hell are we going down that road.
class Person
include DataMapper::Resource
property :id, Serial
property :screen_name, String, :unique_index => true
property :name, String
property :profile_image_url, String
# storing these will allow us to rank this person against other users
# if we wish, we can also use these as cached results from Twitter if the user
# returns to the site within a certain amount of time
property :followers_count, Integer
property :statuses_count, Integer
property :joined_twitter_at, DateTime
# storing the created_at timestamp will help us track site participation
# in order to have this set for us automatically, we've added:
# require 'dm-timestamps'
# to the list of required gems.
property :created_at, DateTime
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.