Class: Tomahawk::ConfigParser
- Inherits:
-
Object
- Object
- Tomahawk::ConfigParser
- Defined in:
- lib/tomahawk/config_parser.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
Returns the value of attribute result.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(config_string) ⇒ ConfigParser
constructor
A new instance of ConfigParser.
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
#result ⇒ Object
Returns the value of attribute result.
3 4 5 |
# File 'lib/tomahawk/config_parser.rb', line 3 def result @result end |
Instance Method Details
#call ⇒ Object
9 10 11 12 |
# File 'lib/tomahawk/config_parser.rb', line 9 def call @config_lines = @config_string.split("\n") parse end |