Class: HtmlToMarkdown::NodeContentImage

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

Overview

An image element.

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#descriptionObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



301
302
303
# File 'lib/html_to_markdown/native.rb', line 301

def description
  @description
end

#image_indexObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



301
302
303
# File 'lib/html_to_markdown/native.rb', line 301

def image_index
  @image_index
end

#srcObject (readonly)

rubocop:disable Lint/UselessMethodDefinition



301
302
303
# File 'lib/html_to_markdown/native.rb', line 301

def src
  @src
end

Class Method Details

.from_hash(hash) ⇒ Object



346
347
348
349
350
351
352
# File 'lib/html_to_markdown/native.rb', line 346

def self.from_hash(hash)
  new(
    description: hash[:description] || hash["description"],
    src: hash[:src] || hash["src"],
    image_index: hash[:image_index] || hash["image_index"]
  )
end

Instance Method Details

#code?Boolean

Returns:

  • (Boolean)


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

def code? = false

#definition_item?Boolean

Returns:

  • (Boolean)


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

def definition_item? = false

#definition_list?Boolean

Returns:

  • (Boolean)


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

def definition_list? = false

#group?Boolean

Returns:

  • (Boolean)


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

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

#heading?Boolean

Returns:

  • (Boolean)


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

def heading? = false

#image?Boolean

Returns:

  • (Boolean)


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

def image? = true

#list?Boolean

Returns:

  • (Boolean)


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

def list? = false

#list_item?Boolean

Returns:

  • (Boolean)


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

def list_item? = false

#metadata_block?Boolean

Returns:

  • (Boolean)


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

def  = false

#paragraph?Boolean

Returns:

  • (Boolean)


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

def paragraph? = false

#quote?Boolean

Returns:

  • (Boolean)


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

def quote? = false

#raw_block?Boolean

Returns:

  • (Boolean)


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

def raw_block? = false

#table?Boolean

Returns:

  • (Boolean)


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

def table? = false