twitter 5.14.0 → 5.15.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (45) hide show
  1. checksums.yaml +7 -7
  2. data/CHANGELOG.md +8 -0
  3. data/LICENSE.md +1 -1
  4. data/README.md +10 -9
  5. data/lib/twitter/configuration.rb +3 -0
  6. data/lib/twitter/entity/uri.rb +2 -2
  7. data/lib/twitter/error.rb +9 -5
  8. data/lib/twitter/factory.rb +1 -1
  9. data/lib/twitter/headers.rb +1 -1
  10. data/lib/twitter/media/photo.rb +3 -0
  11. data/lib/twitter/media/video.rb +3 -0
  12. data/lib/twitter/media/video_info.rb +3 -0
  13. data/lib/twitter/null_object.rb +4 -0
  14. data/lib/twitter/place.rb +5 -3
  15. data/lib/twitter/profile_banner.rb +3 -0
  16. data/lib/twitter/rate_limit.rb +4 -0
  17. data/lib/twitter/rest/direct_messages.rb +8 -8
  18. data/lib/twitter/rest/favorites.rb +4 -4
  19. data/lib/twitter/rest/friends_and_followers.rb +14 -14
  20. data/lib/twitter/rest/help.rb +4 -4
  21. data/lib/twitter/rest/lists.rb +19 -19
  22. data/lib/twitter/rest/media.rb +1 -1
  23. data/lib/twitter/rest/oauth.rb +3 -3
  24. data/lib/twitter/rest/places_and_geo.rb +4 -4
  25. data/lib/twitter/rest/request/multipart_with_file.rb +6 -0
  26. data/lib/twitter/rest/saved_searches.rb +6 -6
  27. data/lib/twitter/rest/search.rb +2 -2
  28. data/lib/twitter/rest/spam_reporting.rb +1 -1
  29. data/lib/twitter/rest/suggested_users.rb +3 -3
  30. data/lib/twitter/rest/timelines.rb +7 -7
  31. data/lib/twitter/rest/trends.rb +3 -3
  32. data/lib/twitter/rest/tweets.rb +22 -20
  33. data/lib/twitter/rest/users.rb +27 -27
  34. data/lib/twitter/rest/utils.rb +4 -4
  35. data/lib/twitter/streaming/client.rb +20 -19
  36. data/lib/twitter/streaming/connection.rb +1 -1
  37. data/lib/twitter/streaming/deleted_tweet.rb +1 -1
  38. data/lib/twitter/suggestion.rb +3 -0
  39. data/lib/twitter/token.rb +3 -0
  40. data/lib/twitter/tweet.rb +5 -1
  41. data/lib/twitter/utils.rb +1 -1
  42. data/lib/twitter/version.rb +41 -11
  43. data/twitter.gemspec +2 -2
  44. metadata +102 -137
  45. data/lib/twitter/value.rb +0 -40
@@ -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