Class: Fretboard::Parser

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

Overview

rubocop:disable Style/Documentation

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(args) ⇒ Parser

Returns a new instance of Parser.



19
20
21
# File 'lib/fretboard/parser.rb', line 19

def initialize(args)
  @args = args
end

Instance Attribute Details

#argsObject (readonly)

Returns the value of attribute args.



13
14
15
# File 'lib/fretboard/parser.rb', line 13

def args
  @args
end

Class Method Details

.parse(args) ⇒ Object



15
16
17
# File 'lib/fretboard/parser.rb', line 15

def self.parse(args)
  new(args).parse
end

Instance Method Details

#parseObject



23
24
25
26
27
# File 'lib/fretboard/parser.rb', line 23

def parse
  parser.parse!(args)
rescue StandardError => e
  Fretboard::Console.danger("Ambiguously completable string is encountered\n#{e}")
end