Class: Tomahawk::ConfigParser

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_string) ⇒ ConfigParser

Returns a new instance of ConfigParser.



4
5
6
7
# File 'lib/tomahawk/config_parser.rb', line 4

def initialize(config_string)
  @config_string = config_string.to_s.strip
  @result = []
end

Instance Attribute Details

#resultObject

Returns the value of attribute result.



3
4
5
# File 'lib/tomahawk/config_parser.rb', line 3

def result
  @result
end

Instance Method Details

#callObject



9
10
11
12
# File 'lib/tomahawk/config_parser.rb', line 9

def call
  @config_lines = @config_string.split("\n")
  parse
end