Created
June 23, 2009 22:35
-
-
Save mrflip/134896 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Wuclan::Models | |
# | |
# Text and metadata for a twitter status update | |
# | |
class Tweet < TypedStruct.new( | |
:id, | |
:created_at, | |
:twitter_user_id, | |
:favorited, | |
:truncated, | |
:in_reply_to_user_id, | |
:in_reply_to_status_id, | |
:text, | |
:source ) | |
include ModelCommon | |
# Memoized; if you change text you have to flush | |
def decoded_text | |
@decoded_text ||= text.wukong_decode | |
end | |
# Key on id | |
def num_key_fields() 1 end | |
def numeric_id_fields() [:id, :twitter_user_id, :in_reply_to_status_id, :in_reply_to_user_id] ; end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment