Class: MDOM::Image

Inherits:
InlineNode show all
Defined in:
lib/mdom/nodes.rb

Instance Attribute Summary

Attributes inherited from Node

#attributes, #children, #parent, #type

Instance Method Summary collapse

Methods inherited from Node

#[], #ancestors, #append, #children?, #depth, #each_child, #empty?, #find, #find_all, #insert_after, #insert_before, #inspect, #plain_text, #pretty_print, #remove, #replace, #root, #text?, #to_markdown, #to_s, #walk

Constructor Details

#initialize(dest, alt: nil, title: nil) ⇒ Image

Returns a new instance of Image.



183
184
185
186
187
188
# File 'lib/mdom/nodes.rb', line 183

def initialize(dest, alt: nil, title: nil)
  attrs = { destination: dest }
  attrs[:alt] = alt unless alt.nil?
  attrs[:title] = title unless title.nil?
  super(Types::IMAGE, attributes: attrs)
end

Instance Method Details

#altObject



194
195
196
# File 'lib/mdom/nodes.rb', line 194

def alt
  attributes[:alt]
end

#destinationObject



190
191
192
# File 'lib/mdom/nodes.rb', line 190

def destination
  attributes[:destination]
end

#titleObject



198
199
200
# File 'lib/mdom/nodes.rb', line 198

def title
  attributes[:title]
end