Class: Topsy::Tweet

Inherits:
Hashie::Mash
  • Object
show all
Defined in:
lib/topsy/tweet.rb

Instance Method Summary collapse

Instance Method Details

#[]=(property, value) ⇒ Object



20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/topsy/tweet.rb', line 20

def []=(property, value)
  case property
    when 'author' then
      if value
        self[:author] = Topsy::Author.new(value)  
      else
        self[:author] = value
      end
    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



16
17
18
# File 'lib/topsy/tweet.rb', line 16

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