Class: Topsy::Tweet
- Inherits:
-
Object
- Object
- Topsy::Tweet
- Defined in:
- lib/rtopsy/tweet.rb
Instance Attribute Summary collapse
-
#author ⇒ Object
Returns the value of attribute author.
-
#content ⇒ Object
Returns the value of attribute content.
-
#date ⇒ Object
Returns the value of attribute date.
-
#date_alpha ⇒ Object
Returns the value of attribute date_alpha.
-
#permalink_url ⇒ Object
Returns the value of attribute permalink_url.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Tweet
constructor
A new instance of Tweet.
- #to_s ⇒ Object
Constructor Details
#initialize(hash) ⇒ Tweet
Returns a new instance of Tweet.
23 24 25 26 27 28 29 30 31 |
# File 'lib/rtopsy/tweet.rb', line 23 def initialize(hash) hash.each do |key, value| if key == 'author' instance_variable_set("@#{key}", Author.new(value)) else instance_variable_set("@#{key}", value) end end end |
Instance Attribute Details
#author ⇒ Object
Returns the value of attribute author.
17 18 19 |
# File 'lib/rtopsy/tweet.rb', line 17 def end |
#content ⇒ Object
Returns the value of attribute content.
17 18 19 |
# File 'lib/rtopsy/tweet.rb', line 17 def content @content end |
#date ⇒ Object
Returns the value of attribute date.
17 18 19 |
# File 'lib/rtopsy/tweet.rb', line 17 def date @date end |
#date_alpha ⇒ Object
Returns the value of attribute date_alpha.
17 18 19 |
# File 'lib/rtopsy/tweet.rb', line 17 def date_alpha @date_alpha end |
#permalink_url ⇒ Object
Returns the value of attribute permalink_url.
17 18 19 |
# File 'lib/rtopsy/tweet.rb', line 17 def permalink_url @permalink_url end |
#type ⇒ Object
Returns the value of attribute type.
17 18 19 |
# File 'lib/rtopsy/tweet.rb', line 17 def type @type end |
Instance Method Details
#to_s ⇒ Object
19 20 21 |
# File 'lib/rtopsy/tweet.rb', line 19 def to_s "Topsy Tweet: #{permalink_url}, #{content}" end |