Class: MindfulDoc

Inherits:
MindmapMFM
  • Object
show all
Defined in:
lib/mindfuldoc.rb

Instance Method Summary collapse

Constructor Details

#initialize(source = nil, cssfile: '', post_url: '', debug: false) ⇒ MindfulDoc

Returns a new instance of MindfulDoc.



10
11
12
13
14
15
16
17
18
19
# File 'lib/mindfuldoc.rb', line 10

def initialize(source=nil, cssfile: '', post_url: '', debug: false)

  @source, @post_url = source, post_url
  s = source ? RXFHelper.read(source).first : ''

  puts ('s: '  + s.inspect).debug if debug
  
  footer = update_footer(s)
  super(s, cssfile: cssfile, footer: footer, debug: debug)
end

Instance Method Details

#refreshObject



25
26
27
# File 'lib/mindfuldoc.rb', line 25

def refresh()
  @s = RXFHelper.read(@source).first
end

#to_htmlObject



21
22
23
# File 'lib/mindfuldoc.rb', line 21

def to_html()
  super()
end

#update(s) ⇒ Object



29
30
31
32
# File 'lib/mindfuldoc.rb', line 29

def update(s)    
  @s = s unless s.strip.empty?
  update_footer(s)
end