Sha256: 59a1c89d0813d23509511eaaa094ba10f589f8442ac268adb85403b8cf52d2ff

Contents?: true

Size: 577 Bytes

Versions: 26

Compression:

Stored size: 577 Bytes

Contents

module Binders
  class Tweets < Bowline::Binders::Collection
    class << self
      def index
        self.items = timeline
      end
      
      def update(status)
        twitter.update(status)
        index # update timeline
      end
      
      protected
        def twitter
          httpauth = Twitter::HTTPAuth.new('user', 'pass')
          Twitter::Base.new(httpauth)
        end
        
        def timeline
          twitter.friends_timeline.collect {|t|
            t.delete('user')
            t.to_hash
          }
        end
    end
    
  end
end # Binders

Version data entries

26 entries across 26 versions & 2 rubygems

Version Path
maccman-bowline-0.1.10 examples/tweets.rb
maccman-bowline-0.1.6 examples/tweets.rb
maccman-bowline-0.1.7 examples/tweets.rb
maccman-bowline-0.1.8 examples/tweets.rb
maccman-bowline-0.3.0 examples/tweets.rb
maccman-bowline-0.3.1 examples/tweets.rb
maccman-bowline-0.3.3 examples/tweets.rb
maccman-bowline-0.3.5 examples/tweets.rb
maccman-bowline-0.3.6 examples/tweets.rb
maccman-bowline-0.3.7 examples/tweets.rb
maccman-bowline-0.3.9 examples/tweets.rb
maccman-bowline-0.4.0 examples/tweets.rb
maccman-bowline-0.4.1 examples/tweets.rb
maccman-bowline-0.4.3 examples/tweets.rb
maccman-bowline-0.4.4 examples/tweets.rb
maccman-bowline-0.4.5 examples/tweets.rb
maccman-bowline-0.4.6 examples/tweets.rb
maccman-bowline-0.4.7 examples/tweets.rb
maccman-bowline-0.4.8 examples/tweets.rb
bowline-0.5.3 examples/tweets.rb