Skip to content

Instantly share code, notes, and snippets.

@thiagoa
Created October 5, 2016 12:18
Show Gist options
  • Save thiagoa/1782beaf5bee5a8bab3b44d90a1394d9 to your computer and use it in GitHub Desktop.
Save thiagoa/1782beaf5bee5a8bab3b44d90a1394d9 to your computer and use it in GitHub Desktop.
Twitter timeline hub
class TwitterTimelineHub
Result = Struct.new(:status, :tweets)
def initialize(twitter_client)
@twitter_client = twitter_client
end
def call(user, count: 20)
tweets = @twitter_client.user_timeline(user, count: count)
Result.new(:ok, tweets)
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment