Skip to content

Instantly share code, notes, and snippets.

@mrflip
Created Jun 23, 2009
Embed
What would you like to do?
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