Class: ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink

Inherits:
Internal::Type::BaseModel show all
Defined in:
lib/context_dev/models/web_extract_styleguide_response.rb

Defined Under Namespace

Modules: Type

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(files:, type:, category: nil, display_name: nil) ⇒ Object

Some parameter documentations has been truncated, see ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink for more details.

Parameters:

  • files (Hash{Symbol=>String})

    Upright font files keyed by weight string (e.g. “400” for regular, “500”, “700”)

  • type (Symbol, ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink::Type)
  • category (String) (defaults to: nil)

    Google Fonts category when type is google (e.g. sans-serif, serif, monospace, di

  • display_name (String) (defaults to: nil)

    Present when type is custom: human-readable name derived from the fontLinks key



# File 'lib/context_dev/models/web_extract_styleguide_response.rb', line 739

Instance Attribute Details

#categoryString?

Google Fonts category when type is google (e.g. sans-serif, serif, monospace, display, handwriting). Omitted for custom fonts when unknown.

Returns:

  • (String, nil)


729
# File 'lib/context_dev/models/web_extract_styleguide_response.rb', line 729

optional :category, String

#display_nameString?

Present when type is custom: human-readable name derived from the fontLinks key (strip build/hash suffixes, split camelCase / PascalCase, normalize separators). Google entries omit this.

Returns:

  • (String, nil)


737
# File 'lib/context_dev/models/web_extract_styleguide_response.rb', line 737

optional :display_name, String, api_name: :displayName

#filesHash{Symbol=>String}

Upright font files keyed by weight string (e.g. “400” for regular, “500”, “700”). Values are absolute URLs.

Returns:

  • (Hash{Symbol=>String})


717
# File 'lib/context_dev/models/web_extract_styleguide_response.rb', line 717

required :files, ContextDev::Internal::Type::HashOf[String]

#typeSymbol, ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink::Type



722
# File 'lib/context_dev/models/web_extract_styleguide_response.rb', line 722

required :type, enum: -> { ContextDev::Models::WebExtractStyleguideResponse::Styleguide::FontLink::Type }