Class: HtmlToMarkdown::NodeContentCode

Inherits:
Data
  • Object
show all
Extended by:
T::Sig
Includes:
NodeContent
Defined in:
lib/html_to_markdown/native.rb

Overview

A code block or inline code.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#languageObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



355
356
357
# File 'lib/html_to_markdown/native.rb', line 355

def language
  @language
end

#textObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



355
356
357
# File 'lib/html_to_markdown/native.rb', line 355

def text
  @text
end

Class Method Details

.from_hash(hash) ⇒ Object



396
397
398
# File 'lib/html_to_markdown/native.rb', line 396

def self.from_hash(hash)
  new(text: hash[:text] || hash["text"], language: hash[:language] || hash["language"])
end

Instance Method Details

#code?Boolean

Returns:

  • (Boolean)


380
# File 'lib/html_to_markdown/native.rb', line 380

def code? = true

#definition_item?Boolean

Returns:

  • (Boolean)


386
# File 'lib/html_to_markdown/native.rb', line 386

def definition_item? = false

#definition_list?Boolean

Returns:

  • (Boolean)


384
# File 'lib/html_to_markdown/native.rb', line 384

def definition_list? = false

#group?Boolean

Returns:

  • (Boolean)


392
393
394
# File 'lib/html_to_markdown/native.rb', line 392

def group? = false
# @param hash [Hash] deserialized from the native extension
# @return [self]

#heading?Boolean

Returns:

  • (Boolean)


368
# File 'lib/html_to_markdown/native.rb', line 368

def heading? = false

#image?Boolean

Returns:

  • (Boolean)


378
# File 'lib/html_to_markdown/native.rb', line 378

def image? = false

#list?Boolean

Returns:

  • (Boolean)


372
# File 'lib/html_to_markdown/native.rb', line 372

def list? = false

#list_item?Boolean

Returns:

  • (Boolean)


374
# File 'lib/html_to_markdown/native.rb', line 374

def list_item? = false

#metadata_block?Boolean

Returns:

  • (Boolean)


390
# File 'lib/html_to_markdown/native.rb', line 390

def  = false

#paragraph?Boolean

Returns:

  • (Boolean)


370
# File 'lib/html_to_markdown/native.rb', line 370

def paragraph? = false

#quote?Boolean

Returns:

  • (Boolean)


382
# File 'lib/html_to_markdown/native.rb', line 382

def quote? = false

#raw_block?Boolean

Returns:

  • (Boolean)


388
# File 'lib/html_to_markdown/native.rb', line 388

def raw_block? = false

#table?Boolean

Returns:

  • (Boolean)


376
# File 'lib/html_to_markdown/native.rb', line 376

def table? = false