Class: XTwitterScraper::Models::TrendListResponse::Trend

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/x_twitter_scraper/models/trend_list_response.rb,
sig/x_twitter_scraper/models/trend_list_response.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Internal::Type::BaseModel

==, #==, #[], coerce, #deconstruct_keys, #deep_to_h, dump, fields, hash, #hash, inherited, inspect, #inspect, known_fields, optional, recursively_to_h, required, #to_h, #to_json, #to_s, to_sorbet_type, #to_yaml

Methods included from Internal::Type::Converter

#coerce, coerce, #dump, dump, #inspect, inspect, meta_info, new_coerce_state, type_info

Methods included from Internal::Util::SorbetRuntimeSupport

#const_missing, #define_sorbet_constant!, #sorbet_constant_defined?, #to_sorbet_type, to_sorbet_type

Constructor Details

#initialize(name:, description: nil, promoted_content: nil, query: nil, rank: nil, tweet_volume: nil, url: nil) ⇒ Object

Parameters:

  • name (String)
  • description (String) (defaults to: nil)
  • promoted_content (String, nil) (defaults to: nil)

    Promotion identifier from X. Null for organic trends.

  • query (String) (defaults to: nil)
  • rank (Integer) (defaults to: nil)
  • tweet_volume (Integer, nil) (defaults to: nil)

    Approximate public post volume when X supplies it.

  • url (String) (defaults to: nil)

    X search URL for the trend.



32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
# File 'lib/x_twitter_scraper/models/trend_list_response.rb', line 32

class Trend < XTwitterScraper::Internal::Type::BaseModel
  # @!attribute name
  #
  #   @return [String]
  required :name, String

  # @!attribute description
  #
  #   @return [String, nil]
  optional :description, String

  # @!attribute promoted_content
  #   Promotion identifier from X. Null for organic trends.
  #
  #   @return [String, nil]
  optional :promoted_content, String, api_name: :promotedContent, nil?: true

  # @!attribute query
  #
  #   @return [String, nil]
  optional :query, String

  # @!attribute rank
  #
  #   @return [Integer, nil]
  optional :rank, Integer

  # @!attribute tweet_volume
  #   Approximate public post volume when X supplies it.
  #
  #   @return [Integer, nil]
  optional :tweet_volume, Integer, api_name: :tweetVolume, nil?: true

  # @!attribute url
  #   X search URL for the trend.
  #
  #   @return [String, nil]
  optional :url, String

  # @!method initialize(name:, description: nil, promoted_content: nil, query: nil, rank: nil, tweet_volume: nil, url: nil)
  #   @param name [String]
  #
  #   @param description [String]
  #
  #   @param promoted_content [String, nil] Promotion identifier from X. Null for organic trends.
  #
  #   @param query [String]
  #
  #   @param rank [Integer]
  #
  #   @param tweet_volume [Integer, nil] Approximate public post volume when X supplies it.
  #
  #   @param url [String] X search URL for the trend.
end

Instance Attribute Details

#descriptionString?

Parameters:

  • (String)

Returns:

  • (String, nil)


41
# File 'lib/x_twitter_scraper/models/trend_list_response.rb', line 41

optional :description, String

#nameString

Parameters:

  • value (String)

Returns:

  • (String)


36
# File 'lib/x_twitter_scraper/models/trend_list_response.rb', line 36

required :name, String

Promotion identifier from X. Null for organic trends.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


47
# File 'lib/x_twitter_scraper/models/trend_list_response.rb', line 47

optional :promoted_content, String, api_name: :promotedContent, nil?: true

#queryString?

Parameters:

  • (String)

Returns:

  • (String, nil)


52
# File 'lib/x_twitter_scraper/models/trend_list_response.rb', line 52

optional :query, String

#rankInteger?

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


57
# File 'lib/x_twitter_scraper/models/trend_list_response.rb', line 57

optional :rank, Integer

#tweet_volumeInteger?

Approximate public post volume when X supplies it.

Parameters:

  • value (Integer, nil)

Returns:

  • (Integer, nil)


63
# File 'lib/x_twitter_scraper/models/trend_list_response.rb', line 63

optional :tweet_volume, Integer, api_name: :tweetVolume, nil?: true

#urlString?

X search URL for the trend.

Parameters:

  • (String)

Returns:

  • (String, nil)


69
# File 'lib/x_twitter_scraper/models/trend_list_response.rb', line 69

optional :url, String

Instance Method Details

#to_hash::Hash[Symbol, top]

Returns:

  • (::Hash[Symbol, top])


59
# File 'sig/x_twitter_scraper/models/trend_list_response.rbs', line 59

def to_hash: -> ::Hash[Symbol, top]