Class: WebletBuilder

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

Instance Method Summary collapse

Constructor Details

#initialize(s, marker: nil, debug: false) ⇒ WebletBuilder

Returns a new instance of WebletBuilder.



11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/weblet.rb', line 11

def initialize(s, marker: nil, debug: false)

  @marker, @debug = marker, debug

  s.strip!

  # the default marker is the hash symbol (#) but the client can set their
  # own marker by simply using their custom symbol in the 1st line of input
  @marker ||= s[0]

  a = scan(s.strip)
  puts 'a: ' + a.inspect if @debug

  @a = build(a)
  @a.unshift *['weblet', {}, '']

end

Instance Method Details

#to_a ⇒ Object



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

def to_a()
  @a
end