twitter 5.14.0 → 5.15.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -7
- data/CHANGELOG.md +8 -0
- data/LICENSE.md +1 -1
- data/README.md +10 -9
- data/lib/twitter/configuration.rb +3 -0
- data/lib/twitter/entity/uri.rb +2 -2
- data/lib/twitter/error.rb +9 -5
- data/lib/twitter/factory.rb +1 -1
- data/lib/twitter/headers.rb +1 -1
- data/lib/twitter/media/photo.rb +3 -0
- data/lib/twitter/media/video.rb +3 -0
- data/lib/twitter/media/video_info.rb +3 -0
- data/lib/twitter/null_object.rb +4 -0
- data/lib/twitter/place.rb +5 -3
- data/lib/twitter/profile_banner.rb +3 -0
- data/lib/twitter/rate_limit.rb +4 -0
- data/lib/twitter/rest/direct_messages.rb +8 -8
- data/lib/twitter/rest/favorites.rb +4 -4
- data/lib/twitter/rest/friends_and_followers.rb +14 -14
- data/lib/twitter/rest/help.rb +4 -4
- data/lib/twitter/rest/lists.rb +19 -19
- data/lib/twitter/rest/media.rb +1 -1
- data/lib/twitter/rest/oauth.rb +3 -3
- data/lib/twitter/rest/places_and_geo.rb +4 -4
- data/lib/twitter/rest/request/multipart_with_file.rb +6 -0
- data/lib/twitter/rest/saved_searches.rb +6 -6
- data/lib/twitter/rest/search.rb +2 -2
- data/lib/twitter/rest/spam_reporting.rb +1 -1
- data/lib/twitter/rest/suggested_users.rb +3 -3
- data/lib/twitter/rest/timelines.rb +7 -7
- data/lib/twitter/rest/trends.rb +3 -3
- data/lib/twitter/rest/tweets.rb +22 -20
- data/lib/twitter/rest/users.rb +27 -27
- data/lib/twitter/rest/utils.rb +4 -4
- data/lib/twitter/streaming/client.rb +20 -19
- data/lib/twitter/streaming/connection.rb +1 -1
- data/lib/twitter/streaming/deleted_tweet.rb +1 -1
- data/lib/twitter/suggestion.rb +3 -0
- data/lib/twitter/token.rb +3 -0
- data/lib/twitter/tweet.rb +5 -1
- data/lib/twitter/utils.rb +1 -1
- data/lib/twitter/version.rb +41 -11
- data/twitter.gemspec +2 -2
- metadata +102 -137
- data/lib/twitter/value.rb +0 -40
data/lib/twitter/value.rb
DELETED
@@ -1,40 +0,0 @@
|
|
1
|
-
module Twitter
|
2
|
-
class Value
|
3
|
-
def self.new(*fields, &block)
|
4
|
-
Class.new do
|
5
|
-
attr_reader(:hash, *fields)
|
6
|
-
|
7
|
-
const_set :VALUE_ATTRS, fields
|
8
|
-
|
9
|
-
define_method(:initialize) do |hash|
|
10
|
-
unexpected_keys = hash.keys - self::VALUE_ATTRS
|
11
|
-
if unexpected_keys.any?
|
12
|
-
fail ArgumentError.new("Unexpected hash keys: #{unexpected_keys}")
|
13
|
-
end
|
14
|
-
|
15
|
-
hash.values_at(*self::VALUE_ATTRS).zip(hash.values) do |field, value|
|
16
|
-
instance_variable_set(:"@#{field}", value)
|
17
|
-
end
|
18
|
-
|
19
|
-
@hash = self.class.hash ^ hash.values.hash
|
20
|
-
|
21
|
-
freeze
|
22
|
-
end
|
23
|
-
|
24
|
-
def ==(other)
|
25
|
-
eql?(other)
|
26
|
-
end
|
27
|
-
|
28
|
-
def eql?(other)
|
29
|
-
self.class == other.class && values == other.values
|
30
|
-
end
|
31
|
-
|
32
|
-
def values
|
33
|
-
self.class::VALUE_ATTRS.map { |field| send(field) }
|
34
|
-
end
|
35
|
-
|
36
|
-
class_eval(&block) if block
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|
40
|
-
end
|