Class: Fig::Deparser::V1

Inherits:
Object
  • Object
show all
Includes:
Fig::Deparser, V1Base
Defined in:
lib/fig/deparser/v1.rb

Overview

Handles serializing of statements in the v1 grammar.

Instance Method Summary collapse

Methods included from V1Base

#command, #retrieve

Methods included from Fig::Deparser

#archive, class_for_statements, #command, #configuration, #deparse, determine_version_and_deparse, #include, #include_file, #override, #path, #resource, #retrieve, #set, #synthetic_raw_text

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.



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

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

#grammar_descriptionObject



35
36
37
# File 'lib/fig/deparser/v1.rb', line 35

def grammar_description()
  return 'v1'
end

#grammar_version(statement) ⇒ Object



27
28
29
30
31
32
33
# File 'lib/fig/deparser/v1.rb', line 27

def grammar_version(statement)
  add_indent

  @text << "grammar v1\n\n"

  return
end