Class: PostForMe::Models::CreateSocialPostPreview::PreviewSocialAccount

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/post_for_me/models/create_social_post_preview.rb,
sig/post_for_me/models/create_social_post_preview.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(id:, platform:, username: nil) ⇒ Object

Parameters:

  • id (String)

    ID of the social account, ex: spc_12312

  • platform (String)

    Platform of the social account

  • username (String) (defaults to: nil)

    username of the social account



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
# File 'lib/post_for_me/models/create_social_post_preview.rb', line 54

class PreviewSocialAccount < PostForMe::Internal::Type::BaseModel
  # @!attribute id
  #   ID of the social account, ex: spc_12312
  #
  #   @return [String]
  required :id, String

  # @!attribute platform
  #   Platform of the social account
  #
  #   @return [String]
  required :platform, String

  # @!attribute username
  #   username of the social account
  #
  #   @return [String, nil]
  optional :username, String

  # @!method initialize(id:, platform:, username: nil)
  #   @param id [String] ID of the social account, ex: spc_12312
  #
  #   @param platform [String] Platform of the social account
  #
  #   @param username [String] username of the social account
end

Instance Attribute Details

#idString

ID of the social account, ex: spc_12312

Parameters:

  • value (String)

Returns:

  • (String)


59
# File 'lib/post_for_me/models/create_social_post_preview.rb', line 59

required :id, String

#platformString

Platform of the social account

Parameters:

  • value (String)

Returns:

  • (String)


65
# File 'lib/post_for_me/models/create_social_post_preview.rb', line 65

required :platform, String

#usernameString?

username of the social account

Parameters:

  • (String)

Returns:

  • (String, nil)


71
# File 'lib/post_for_me/models/create_social_post_preview.rb', line 71

optional :username, String

Instance Method Details

#to_hash{ id: String, platform: String, username: String }

Returns:

  • ({ id: String, platform: String, username: String })


57
# File 'sig/post_for_me/models/create_social_post_preview.rbs', line 57

def to_hash: -> { id: String, platform: String, username: String }