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



351
352
353
# File 'lib/html_to_markdown/native.rb', line 351

def language
  @language
end

#textObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



351
352
353
# File 'lib/html_to_markdown/native.rb', line 351

def text
  @text
end

Class Method Details

.from_hash(hash) ⇒ Object



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

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

Instance Method Details

#code?Boolean

Returns:

  • (Boolean)


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

def code? = true

#definition_item?Boolean

Returns:

  • (Boolean)


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

def definition_item? = false

#definition_list?Boolean

Returns:

  • (Boolean)


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

def definition_list? = false

#group?Boolean

Returns:

  • (Boolean)


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

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

#heading?Boolean

Returns:

  • (Boolean)


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

def heading? = false

#image?Boolean

Returns:

  • (Boolean)


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

def image? = false

#list?Boolean

Returns:

  • (Boolean)


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

def list? = false

#list_item?Boolean

Returns:

  • (Boolean)


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

def list_item? = false

#metadata_block?Boolean

Returns:

  • (Boolean)


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

def  = false

#paragraph?Boolean

Returns:

  • (Boolean)


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

def paragraph? = false

#quote?Boolean

Returns:

  • (Boolean)


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

def quote? = false

#raw_block?Boolean

Returns:

  • (Boolean)


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

def raw_block? = false

#table?Boolean

Returns:

  • (Boolean)


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

def table? = false