Class: Fig::Unparser::V1

Inherits:
Object
  • Object
show all
Includes:
Fig::Unparser
Defined in:
lib/fig/unparser/v1.rb

Overview

Handles serializing of statements in the v1 grammar.

Instance Method Summary collapse

Methods included from Fig::Unparser

#archive, #configuration, #include, #override, #path, #resource, #retrieve, #set, #unparse

Constructor Details

#initialize(emit_as_input_or_to_be_published_values, indent_string = ' ' * 2, initial_indent_level = 0) ⇒ V1

Returns a new instance of V1.



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/fig/unparser/v1.rb', line 10

def initialize(
  emit_as_input_or_to_be_published_values,
  indent_string = ' ' * 2,
  initial_indent_level = 0
)
  @emit_as_input_or_to_be_published_values =
    emit_as_input_or_to_be_published_values
  @indent_string        = indent_string
  @initial_indent_level = initial_indent_level

  return
end

Instance Method Details

#command(statement) ⇒ Object



23
24
25
26
27
28
29
30
31
# File 'lib/fig/unparser/v1.rb', line 23

def command(statement)
  add_indent

  @text << %q<command ">
  @text << statement.command
  @text << %Q<"\n>

  return
end

#grammar_version(statement) ⇒ Object



33
34
35
36
37
38
39
# File 'lib/fig/unparser/v1.rb', line 33

def grammar_version(statement)
  add_indent

  @text << "grammar v1\n"

  return
end