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



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

def language
  @language
end

#textObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



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

def text
  @text
end

Class Method Details

.from_hash(hash) ⇒ Object



423
424
425
# File 'lib/html_to_markdown/native.rb', line 423

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

Instance Method Details

#code?Boolean

Returns:

  • (Boolean)


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

def code? = true

#definition_item?Boolean

Returns:

  • (Boolean)


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

def definition_item? = false

#definition_list?Boolean

Returns:

  • (Boolean)


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

def definition_list? = false

#group?Boolean

Returns:

  • (Boolean)


419
420
421
# File 'lib/html_to_markdown/native.rb', line 419

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

#heading?Boolean

Returns:

  • (Boolean)


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

def heading? = false

#image?Boolean

Returns:

  • (Boolean)


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

def image? = false

#list?Boolean

Returns:

  • (Boolean)


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

def list? = false

#list_item?Boolean

Returns:

  • (Boolean)


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

def list_item? = false

#metadata_block?Boolean

Returns:

  • (Boolean)


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

def  = false

#paragraph?Boolean

Returns:

  • (Boolean)


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

def paragraph? = false

#quote?Boolean

Returns:

  • (Boolean)


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

def quote? = false

#raw_block?Boolean

Returns:

  • (Boolean)


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

def raw_block? = false

#table?Boolean

Returns:

  • (Boolean)


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

def table? = false