Class: Junoser::Display::Set
- Inherits:
-
Object
- Object
- Junoser::Display::Set
- Defined in:
- lib/junoser/display/set.rb
Instance Method Summary collapse
- #commit_check(&block) ⇒ Object
-
#initialize(io_or_string) ⇒ Set
constructor
A new instance of Set.
- #transform ⇒ Object
Constructor Details
#initialize(io_or_string) ⇒ Set
Returns a new instance of Set.
7 8 9 |
# File 'lib/junoser/display/set.rb', line 7 def initialize(io_or_string) @input = io_or_string end |
Instance Method Details
#commit_check(&block) ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/junoser/display/set.rb', line 21 def commit_check(&block) begin lines = transform rescue $stderr.puts $! return false end parser = Junoser::Parser.new parser.parse_lines(lines) end |
#transform ⇒ Object
11 12 13 14 15 16 17 18 19 |
# File 'lib/junoser/display/set.rb', line 11 def transform result = '' process do |current_stack, str| result << transform_line(current_stack, str) << "\n" end result end |