Class: WhoNeedsWP::TwitterFeed

Inherits:
TwitterSidebar show all
Defined in:
lib/who-needs-wp/sidebar/twitter.rb

Overview

A Sidebar component which displays a list of a user’s tweets

Instance Method Summary collapse

Methods inherited from Sidebar

render_all

Constructor Details

#initialize(username) ⇒ TwitterFeed

Create a new Twitter sidebar based on “username”‘s tweets



25
26
27
28
29
# File 'lib/who-needs-wp/sidebar/twitter.rb', line 25

def initialize(username)
  super()
  @username = username
  validate_options
end

Instance Method Details

#renderObject

See Sidebar.render



32
33
34
35
36
37
# File 'lib/who-needs-wp/sidebar/twitter.rb', line 32

def render
  WhoNeedsWP::render_template("twitter", {
    :tweets => tweets,
    :feed_title => "@#{@username}"
  })
end