Method: Fig::Statement::Path.parse_name_value

Defined in:
lib/fig/statement/path.rb

.parse_name_value(combined, &error_block) ⇒ Object

Yields on error.



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/fig/statement/path.rb', line 14

def self.parse_name_value(combined, &error_block)
  variable, raw_value = seperate_name_and_value combined, &error_block

  tokenized_value = tokenize_value(raw_value, &error_block)

  if tokenized_value.to_escaped_string.length < 1
    yield %Q<The value of path variable #{variable} is empty.>
    return
  end

  return [variable, tokenized_value]
end