Class: TeamCymru::TwitterFeed
- Inherits:
-
Object
- Object
- TeamCymru::TwitterFeed
- Defined in:
- lib/teamcymru/twitterfeed.rb
Instance Attribute Summary collapse
-
#messages ⇒ Object
readonly
Returns the value of attribute messages.
Instance Method Summary collapse
-
#initialize(config) ⇒ TwitterFeed
constructor
A new instance of TwitterFeed.
- #refresh ⇒ Object
Constructor Details
#initialize(config) ⇒ TwitterFeed
Returns a new instance of TwitterFeed.
6 7 8 9 10 11 12 13 |
# File 'lib/teamcymru/twitterfeed.rb', line 6 def initialize(config) @twitname = "teamcymru" @messages = [] @client = Twitter::Client.new(config) @client.user_timeline(@twitname).each do |m| @messages << [m.created_at,m.text] end end |
Instance Attribute Details
#messages ⇒ Object (readonly)
Returns the value of attribute messages.
5 6 7 |
# File 'lib/teamcymru/twitterfeed.rb', line 5 def @messages end |
Instance Method Details
#refresh ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/teamcymru/twitterfeed.rb', line 15 def refresh @messages = [] @client.user_timeline(@twitname).each do |m| @messages << [m.created_at,m.text] end @messages end |