Class: Fall::Parser

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

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ Parser

Returns a new instance of Parser.



3
4
5
# File 'lib/fall/parser.rb', line 3

def initialize(string)
  @string = string
end

Instance Method Details

#parseObject



12
13
14
15
16
17
# File 'lib/fall/parser.rb', line 12

def parse
  stages
    .then { identify_streams(_1) }
    .then { consolidate_streams(_1) }
    .then { create_operations(_1) }
end

#stagesObject



7
8
9
10
# File 'lib/fall/parser.rb', line 7

def stages
  @string.split('|')
         .map(&:strip)
end