Class: Strawman::TwitterSource
- Includes:
- EventMachine::Deferrable
- Defined in:
- lib/strawman/source.rb
Constant Summary collapse
- ONE_HOUR =
60*60
Instance Attribute Summary collapse
-
#proxies ⇒ Object
readonly
Returns the value of attribute proxies.
Instance Method Summary collapse
-
#initialize(twitter_username) ⇒ TwitterSource
constructor
A new instance of TwitterSource.
Constructor Details
#initialize(twitter_username) ⇒ TwitterSource
Returns a new instance of TwitterSource.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/strawman/source.rb', line 10 def initialize(twitter_username) @id = twitter_username fetched = update_cache fetched.callback do @proxies = JSON.parse(read_cache).map do |status| match = /.*(http:\/\/.*)/.match(status["text"]) if match GlypeProxy.new(match[1]) else nil end end.compact set_deferred_status :succeeded end end |
Instance Attribute Details
#proxies ⇒ Object (readonly)
Returns the value of attribute proxies.
8 9 10 |
# File 'lib/strawman/source.rb', line 8 def proxies @proxies end |