Class: Junoser::Display::Set

Inherits:
Object
  • Object
show all
Defined in:
lib/junoser/display/set.rb

Instance Method Summary collapse

Constructor Details

#initialize(io_or_string) ⇒ Set



10
11
12
# File 'lib/junoser/display/set.rb', line 10

def initialize(io_or_string)
  @input = io_or_string
end

Instance Method Details

#commit_checkObject



24
25
26
27
28
29
30
31
32
33
34
# File 'lib/junoser/display/set.rb', line 24

def commit_check
  begin
    lines = transform
  rescue StandardError
    warn $ERROR_INFO
    return false
  end

  parser = Junoser::Parser.new
  parser.parse_lines(lines)
end

#transformObject



14
15
16
17
18
19
20
21
22
# File 'lib/junoser/display/set.rb', line 14

def transform
  result = +''

  process do |current_stack, str|
    result << transform_line(current_stack, str) << "\n"
  end

  result
end