Module: Lydown::Parsing::Command::Argument

Defined in:
lib/lydown/parsing/nodes.rb

Instance Method Summary collapse

Instance Method Details

#to_stream(cmd, opts) ⇒ Object



378
379
380
381
382
383
384
385
386
387
388
389
390
391
# File 'lib/lydown/parsing/nodes.rb', line 378

def to_stream(cmd, opts)
  if text_value =~ /^"(.+)"$/
    value = $1.unescape
  else
    value = text_value
  end
  
  if cmd[:type] == :setting
    cmd[:value] = value
  else
    cmd[:arguments] ||= []
    cmd[:arguments] << value
  end
end