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



324
325
326
# File 'lib/html_to_markdown/native.rb', line 324

def language
  @language
end

#textObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



324
325
326
# File 'lib/html_to_markdown/native.rb', line 324

def text
  @text
end

Class Method Details

.from_hash(hash) ⇒ Object



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

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

Instance Method Details

#code?Boolean

Returns:

  • (Boolean)


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

def code? = true

#definition_item?Boolean

Returns:

  • (Boolean)


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

def definition_item? = false

#definition_list?Boolean

Returns:

  • (Boolean)


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

def definition_list? = false

#group?Boolean

Returns:

  • (Boolean)


359
360
361
# File 'lib/html_to_markdown/native.rb', line 359

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

#heading?Boolean

Returns:

  • (Boolean)


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

def heading? = false

#image?Boolean

Returns:

  • (Boolean)


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

def image? = false

#list?Boolean

Returns:

  • (Boolean)


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

def list? = false

#list_item?Boolean

Returns:

  • (Boolean)


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

def list_item? = false

#metadata_block?Boolean

Returns:

  • (Boolean)


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

def  = false

#paragraph?Boolean

Returns:

  • (Boolean)


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

def paragraph? = false

#quote?Boolean

Returns:

  • (Boolean)


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

def quote? = false

#raw_block?Boolean

Returns:

  • (Boolean)


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

def raw_block? = false

#table?Boolean

Returns:

  • (Boolean)


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

def table? = false