Class: Courier::Models::TopicDigestCategory

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

Defined Under Namespace

Modules: Retain

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(category_key:, limit: nil, retain: nil, sort_key: nil) ⇒ Object

Some parameter documentations has been truncated, see Courier::Models::TopicDigestCategory for more details.

How events collected under a category key are retained when a digest holds more than it will render.

Parameters:

  • category_key (String) —

    The key that identifies the category within the digest.

  • limit (Integer) (defaults to: nil) —

    How many collected events are carried into the rendered digest. Defaults to 10.

  • retain (Symbol, Courier::Models::TopicDigestCategory::Retain) (defaults to: nil) —

    Which collected events survive the limit. FIRST and LOWEST keep the earlie

  • sort_key (String) (defaults to: nil) —

    The data key used to rank events. Required when retain is HIGHEST or `LOWEST



# File 'lib/courier/models/topic_digest_category.rb', line 37

Instance Attribute Details

#category_key ⇒ String

The key that identifies the category within the digest.

Parameters:

  • value (String)

Returns:

  • (String)


10
# File 'lib/courier/models/topic_digest_category.rb', line 10

required :category_key, String

#limit ⇒ Integer?

How many collected events are carried into the rendered digest. Defaults to 10.

Events beyond the limit are discarded, not held back for the next digest: the release consumes everything collected so far and only limit of them appear. retain decides which ones those are.

Parameters:

  • (Integer)

Returns:

  • (Integer, nil)


20
# File 'lib/courier/models/topic_digest_category.rb', line 20

optional :limit, Integer

#retain ⇒ Symbol, ...

Which collected events survive the limit. FIRST and LOWEST keep the earliest or smallest; LAST and HIGHEST keep the latest or largest. Accepted case-insensitively, returned uppercase.



28
# File 'lib/courier/models/topic_digest_category.rb', line 28

optional :retain, enum: -> { Courier::TopicDigestCategory::Retain }

#sort_key ⇒ String?

The data key used to rank events. Required when retain is HIGHEST or LOWEST.

Parameters:

  • (String)

Returns:

  • (String, nil)


35
# File 'lib/courier/models/topic_digest_category.rb', line 35

optional :sort_key, String

Instance Method Details

#to_hash ⇒ {

Returns:

  • ({)


35
# File 'sig/courier/models/topic_digest_category.rbs', line 35

def to_hash: -> {