Module: Fig::Deparser::V1Base

Included in:
V1, V2
Defined in:
lib/fig/deparser/v1_base.rb

Overview

Handles serializing of statements in the v1 grammar.

Instance Method Summary collapse

Instance Method Details

#command(statement) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/fig/deparser/v1_base.rb', line 8

def command(statement)
  add_indent
  @text << %Q<command\n>

  add_indent(@indent_level + 1)
  statement.command.each do
    |argument|

    emit_tokenized_value argument
    @text << ' '
  end

  @text << %Q<\n>
  add_indent
  @text << %Q<end\n>

  return
end

#retrieve(statement) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'lib/fig/deparser/v1_base.rb', line 27

def retrieve(statement)
  add_indent

  @text << 'retrieve '
  @text << statement.variable
  @text << '->'

  emit_tokenized_value statement.tokenized_path

  @text << "\n"

  return
end