Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Remove Twitter::Tweet#favoriters, #repliers, #repliers_count, and #re…

…tweeters

Closes #419.
  • Loading branch information...
commit 77cc963381a68e8299ef6c6b7a306b440666d792 1 parent 7f97081
@sferik authored
Showing with 6 additions and 67 deletions.
  1. +6 −26 lib/twitter/tweet.rb
  2. +0 −41 spec/twitter/tweet_spec.rb
View
32 lib/twitter/tweet.rb
@@ -8,19 +8,19 @@ class Tweet < Twitter::Identity
extend Forwardable
include Twitter::Creatable
include Twitter::Exceptable
- attr_reader :favorite_count, :favorited, :favoriters, :from_user_id,
- :from_user_name, :in_reply_to_screen_name, :in_reply_to_attrs_id,
- :in_reply_to_status_id, :in_reply_to_user_id, :lang, :repliers,
- :retweeted, :retweeters, :source, :text, :to_user, :to_user_id,
- :to_user_name, :truncated
+ attr_reader :favorite_count, :favorited, :from_user_id, :from_user_name,
+ :in_reply_to_screen_name, :in_reply_to_attrs_id, :in_reply_to_status_id,
+ :in_reply_to_user_id, :lang, :retweet_count, :retweeted, :source, :text,
+ :to_user, :to_user_id, :to_user_name, :truncated
alias in_reply_to_tweet_id in_reply_to_status_id
alias favorites_count favorite_count
alias favourite_count favorite_count
alias favourites_count favorite_count
+ alias favoriters_count favorite_count
alias favouriters_count favorite_count
alias favourited favorited
alias favourited? favorited?
- alias favouriters favoriters
+ alias retweeters_count retweet_count
def_delegators :user, :profile_image_url, :profile_image_url_https
# @return [Boolean]
@@ -28,12 +28,6 @@ def entities?
!@attrs[:entities].nil?
end
- # @return [Integer]
- def favoriters_count
- favoriters_count = @attrs[:favoriters_count]
- favoriters_count.to_i if favoriters_count
- end
-
# @return [String]
def from_user
@attrs[:from_user] || user && user.screen_name
@@ -81,13 +75,6 @@ def place
@place ||= Twitter::Place.fetch_or_new(@attrs[:place])
end
- # @return [Integer]
- def repliers_count
- repliers_count = @attrs[:repliers_count]
- repliers_count.to_i if repliers_count
- end
- alias reply_count repliers_count
-
# @return [Boolean]
def reply?
!!in_reply_to_status_id
@@ -107,13 +94,6 @@ def retweeted_status
alias retweeted_tweet retweeted_status
alias retweet retweeted_status
- # @return [String]
- def retweeters_count
- retweeters_count = (@attrs[:retweet_count] || @attrs[:retweeters_count])
- retweeters_count.to_i if retweeters_count
- end
- alias retweet_count retweeters_count
-
# @note Must include entities in your request for this method to work
# @return [Array<Twitter::Entity::Symbol>]
def symbols
View
41 spec/twitter/tweet_spec.rb
@@ -60,18 +60,6 @@
end
end
- describe "#favoriters_count" do
- it "returns the count of favoriters when favoriters_count is set" do
- tweet = Twitter::Tweet.new(:id => 28669546014, :favoriters_count => '1')
- expect(tweet.favoriters_count).to be_an Integer
- expect(tweet.favoriters_count).to eq 1
- end
- it "returns nil when not set" do
- tweet = Twitter::Tweet.new(:id => 28669546014)
- expect(tweet.favoriters_count).to be_nil
- end
- end
-
describe "#from_user" do
it "returns a screen name when from_user is set" do
tweet = Twitter::Tweet.new(:id => 28669546014, :from_user => 'sferik')
@@ -196,18 +184,6 @@
end
end
- describe "#repliers_count" do
- it "returns the count of favoriters when repliers_count is set" do
- tweet = Twitter::Tweet.new(:id => 28669546014, :repliers_count => '1')
- expect(tweet.repliers_count).to be_an Integer
- expect(tweet.repliers_count).to eq 1
- end
- it "returns nil when not set" do
- tweet = Twitter::Tweet.new(:id => 28669546014)
- expect(tweet.repliers_count).to be_nil
- end
- end
-
describe "#reply?" do
it "returns true when there is an in-reply-to status" do
tweet = Twitter::Tweet.new(:id => 28669546014, :in_reply_to_status_id => 114749583439036416)
@@ -242,23 +218,6 @@
end
end
- describe "#retweeters_count" do
- it "returns the count of favoriters when retweet_count is set" do
- tweet = Twitter::Tweet.new(:id => 28669546014, :retweet_count => '1')
- expect(tweet.retweeters_count).to be_an Integer
- expect(tweet.retweeters_count).to eq 1
- end
- it "returns the count of favoriters when retweeters_count is set" do
- tweet = Twitter::Tweet.new(:id => 28669546014, :retweeters_count => '1')
- expect(tweet.retweeters_count).to be_an Integer
- expect(tweet.retweeters_count).to eq 1
- end
- it "returns nil when not set" do
- tweet = Twitter::Tweet.new(:id => 28669546014)
- expect(tweet.retweeters_count).to be_nil
- end
- end
-
describe "#symbols" do
it "returns an Array of Entity::Symbol when symbols are set" do
symbols_array = [
Please sign in to comment.
Something went wrong with that request. Please try again.