Class: Gemtext::Preformatted

Inherits:
Node
  • Object
show all
Defined in:
lib/gemtext/preformatted.rb

Instance Attribute Summary

Attributes inherited from Node

#content

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Node

#==, #deconstruct_keys

Constructor Details

#initialize(content, caption = nil) ⇒ Preformatted

Returns a new instance of Preformatted.



3
4
5
6
# File 'lib/gemtext/preformatted.rb', line 3

def initialize(content, caption = nil)
  super content
  @caption = caption
end

Class Method Details

.[](content, caption = nil) ⇒ Object



8
9
10
# File 'lib/gemtext/preformatted.rb', line 8

def self.[](content, caption = nil)
  new content, caption
end

Instance Method Details

#inspectObject



12
13
14
# File 'lib/gemtext/preformatted.rb', line 12

def inspect
  "#{self.class}{#{content}|{#{@caption}}"
end