Class: MDOM::Image
- Inherits:
-
InlineNode
- Object
- Node
- InlineNode
- MDOM::Image
- Defined in:
- lib/mdom/nodes.rb
Instance Attribute Summary
Attributes inherited from Node
#attributes, #children, #parent, #type
Instance Method Summary collapse
- #alt ⇒ Object
- #destination ⇒ Object
-
#initialize(dest, alt: nil, title: nil) ⇒ Image
constructor
A new instance of Image.
- #title ⇒ Object
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
#alt ⇒ Object
194 195 196 |
# File 'lib/mdom/nodes.rb', line 194 def alt attributes[:alt] end |
#destination ⇒ Object
190 191 192 |
# File 'lib/mdom/nodes.rb', line 190 def destination attributes[:destination] end |
#title ⇒ Object
198 199 200 |
# File 'lib/mdom/nodes.rb', line 198 def title attributes[:title] end |