Class: TweetAbout::TweetWords
- Inherits:
-
Object
- Object
- TweetAbout::TweetWords
- Defined in:
- lib/tweetabout/tweet_words.rb
Instance Attribute Summary collapse
-
#status ⇒ Object
Returns the value of attribute status.
-
#words ⇒ Object
Returns the value of attribute words.
Instance Method Summary collapse
-
#initialize(username) ⇒ TweetWords
constructor
A new instance of TweetWords.
- #sort_words(options = {}) ⇒ Object
Constructor Details
#initialize(username) ⇒ TweetWords
Returns a new instance of TweetWords.
7 8 9 |
# File 'lib/tweetabout/tweet_words.rb', line 7 def initialize(username) @username = username end |
Instance Attribute Details
#status ⇒ Object
Returns the value of attribute status.
4 5 6 |
# File 'lib/tweetabout/tweet_words.rb', line 4 def status @status end |
#words ⇒ Object
Returns the value of attribute words.
5 6 7 |
# File 'lib/tweetabout/tweet_words.rb', line 5 def words @words end |
Instance Method Details
#sort_words(options = {}) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/tweetabout/tweet_words.rb', line 11 def sort_words(={}) to_i = [:tweets].to_i tweets_needed = to_i > 0? to_i : 200 [:tweets] = tweets_needed get_words if self.status == :ok words = self.words sorted_words = words.sort sorted_words = [:with_count]? sorted_words : sorted_words.keys self.words = sorted_words end self end |