Class: PostForMe::Models::TwitterPoll

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

Defined Under Namespace

Modules: ReplySettings

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(duration_minutes:, options:, reply_settings: nil) ⇒ Object

Parameters:

  • duration_minutes (Float)

    Duration of the poll in minutes

  • options (Array<String>)

    The choices of the poll, requiring 2-4 options

  • reply_settings (Symbol, PostForMe::Models::TwitterPoll::ReplySettings) (defaults to: nil)

    Who can reply to the tweet



# File 'lib/post_for_me/models/twitter_poll.rb', line 24

Instance Attribute Details

#duration_minutesFloat

Duration of the poll in minutes

Parameters:

  • value (Float)

Returns:

  • (Float)


10
# File 'lib/post_for_me/models/twitter_poll.rb', line 10

required :duration_minutes, Float

#optionsArray<String>

The choices of the poll, requiring 2-4 options

Parameters:

  • value (::Array[String])

Returns:

  • (Array<String>)


16
# File 'lib/post_for_me/models/twitter_poll.rb', line 16

required :options, PostForMe::Internal::Type::ArrayOf[String]

#reply_settingsSymbol, ...

Who can reply to the tweet



22
# File 'lib/post_for_me/models/twitter_poll.rb', line 22

optional :reply_settings, enum: -> { PostForMe::TwitterPoll::ReplySettings }

Instance Method Details

#to_hash{

Returns:

  • ({)


27
# File 'sig/post_for_me/models/twitter_poll.rbs', line 27

def to_hash: -> {