Class: WhopSDK::Models::Ad::Creative

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

Defined Under Namespace

Modules: Format Classes: Crop

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(height:, width:, x:, y_:) ⇒ Object

The saved crop window for this creative, in source image pixels. Null for the original asset or a format that has not been cropped.

Parameters:

  • height (Float)

    Height of the crop window in source pixels.

  • width (Float)

    Width of the crop window in source pixels.

  • x (Float)

    Left edge of the crop window in source pixels.

  • y_ (Float)

    Top edge of the crop window in source pixels.



# File 'lib/whop_sdk/models/ad.rb', line 611

Instance Attribute Details

#cropWhopSDK::Models::Ad::Creative::Crop?

The saved crop window for this creative, in source image pixels. Null for the original asset or a format that has not been cropped.

Parameters:

  • value (WhopSDK::Ad::Creative::Crop, nil)

Returns:



591
# File 'lib/whop_sdk/models/ad.rb', line 591

required :crop, -> { WhopSDK::Ad::Creative::Crop }, nil?: true

#format_Symbol, ...

The placement variant this asset covers, or null for the original asset.

Parameters:

  • value (WhopSDK::Models::Ad::Creative::format_, nil)

Returns:



597
# File 'lib/whop_sdk/models/ad.rb', line 597

required :format_, enum: -> { WhopSDK::Ad::Creative::Format }, api_name: :format, nil?: true

#idString

The creative attachment's file id.

Parameters:

  • value (String)

Returns:

  • (String)


584
# File 'lib/whop_sdk/models/ad.rb', line 584

required :id, String

#media_typeString?

The kind of asset, image or video.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


603
# File 'lib/whop_sdk/models/ad.rb', line 603

required :media_type, String, nil?: true

#urlString?

CDN url of the asset.

Parameters:

  • value (String, nil)

Returns:

  • (String, nil)


609
# File 'lib/whop_sdk/models/ad.rb', line 609

required :url, String, nil?: true

Instance Method Details

#to_hash{

Returns:

  • ({)


428
# File 'sig/whop_sdk/models/ad.rbs', line 428

def to_hash: -> {