Class: Believe::Models::Quote

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/believe/models/quote.rb

Overview

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(id:, character_id:, context:, moment_type:, text:, theme:, episode_id: nil, is_funny: nil, is_inspirational: nil, popularity_score: nil, secondary_themes: nil, times_shared: nil) ⇒ Object

Full quote model with ID.

Parameters:

  • id (String)

    Unique identifier

  • character_id (String)

    ID of the character who said it

  • context (String)

    Context in which the quote was said

  • moment_type (Symbol, ::Believe::Models::QuoteMoment)

    Type of moment when the quote was said

  • text (String)

    The quote text

  • theme (Symbol, ::Believe::Models::QuoteTheme)

    Primary theme of the quote

  • episode_id (String, nil) (defaults to: nil)

    Episode where the quote appears

  • is_funny (Boolean) (defaults to: nil)

    Whether this quote is humorous

  • is_inspirational (Boolean) (defaults to: nil)

    Whether this quote is inspirational

  • popularity_score (Float, nil) (defaults to: nil)

    Popularity/virality score (0-100)

  • secondary_themes (Array<Symbol, ::Believe::Models::QuoteTheme>) (defaults to: nil)

    Additional themes

  • times_shared (Integer, nil) (defaults to: nil)

    Number of times shared on social media



# File 'lib/believe/models/quote.rb', line 79

Instance Attribute Details

#character_idString

ID of the character who said it

Returns:

  • (String)


17
# File 'lib/believe/models/quote.rb', line 17

required :character_id, String

#contextString

Context in which the quote was said

Returns:

  • (String)


23
# File 'lib/believe/models/quote.rb', line 23

required :context, String

#episode_idString?

Episode where the quote appears

Returns:

  • (String, nil)


47
# File 'lib/believe/models/quote.rb', line 47

optional :episode_id, String, nil?: true

#idString

Unique identifier

Returns:

  • (String)


11
# File 'lib/believe/models/quote.rb', line 11

required :id, String

#is_funnyBoolean?

Whether this quote is humorous

Returns:

  • (Boolean, nil)


53
# File 'lib/believe/models/quote.rb', line 53

optional :is_funny, ::Believe::Internal::Type::Boolean

#is_inspirationalBoolean?

Whether this quote is inspirational

Returns:

  • (Boolean, nil)


59
# File 'lib/believe/models/quote.rb', line 59

optional :is_inspirational, ::Believe::Internal::Type::Boolean

#moment_typeSymbol, ::Believe::Models::QuoteMoment

Type of moment when the quote was said

Returns:



29
# File 'lib/believe/models/quote.rb', line 29

required :moment_type, enum: -> { ::Believe::QuoteMoment }

#popularity_scoreFloat?

Popularity/virality score (0-100)

Returns:

  • (Float, nil)


65
# File 'lib/believe/models/quote.rb', line 65

optional :popularity_score, Float, nil?: true

#secondary_themesArray<Symbol, ::Believe::Models::QuoteTheme>?

Additional themes

Returns:



71
# File 'lib/believe/models/quote.rb', line 71

optional :secondary_themes, -> { ::Believe::Internal::Type::ArrayOf[enum: ::Believe::QuoteTheme] }

#textString

The quote text

Returns:

  • (String)


35
# File 'lib/believe/models/quote.rb', line 35

required :text, String

#themeSymbol, ::Believe::Models::QuoteTheme

Primary theme of the quote

Returns:



41
# File 'lib/believe/models/quote.rb', line 41

required :theme, enum: -> { ::Believe::QuoteTheme }

#times_sharedInteger?

Number of times shared on social media

Returns:

  • (Integer, nil)


77
# File 'lib/believe/models/quote.rb', line 77

optional :times_shared, Integer, nil?: true