Class: Topsy::Linkpost

Inherits:
Hashie::Dash
  • Object
show all
Defined in:
lib/topsy/linkpost.rb

Overview

This is the linkpost class for the topsy library. A Linkpost has the following attributes:

"permalink_url" : "http://twitter.com/barackobama/status/3569838653",
"target" : target instance
"date" : "1251337427",
"content" : "Highlights from the tribute to Sen. Kennedy's life and 
             accomplishments from last year's Democratic National Convention: http://bit.ly/TJcyr",
"date_alpha" : "3 hours ago"

According to the official Topsy doc: code.google.com/p/otterapi/wiki/Resources?tm=6#/linkposts

Instance Method Summary collapse

Instance Method Details

#[]=(property, value) ⇒ Object



23
24
25
26
27
28
29
30
31
32
33
34
# File 'lib/topsy/linkpost.rb', line 23

def []=(property, value)
  case property
    when 'target' then
      if value
        self[:target] = Topsy::Target.new(value)  
      else
        self[:target] = value
      end
    else
      super(property.to_s, value)
  end
end

#to_sObject



19
20
21
# File 'lib/topsy/linkpost.rb', line 19

def to_s
  "Topsy Linkpost: #{permalink_url}, @#{content}"
end