Class: Fig::Statement::Set

Inherits:
Fig::Statement show all
Includes:
EnvironmentVariable
Defined in:
lib/fig/statement/set.rb

Overview

A statement that sets the value of an environment variable.

Constant Summary

Constants inherited from Fig::Statement

ENVIRONMENT_VARIABLE_NAME_REGEX

Instance Attribute Summary

Attributes included from EnvironmentVariable

#name, #tokenized_value

Attributes inherited from Fig::Statement

#column, #line, #source_description

Class Method Summary collapse

Instance Method Summary collapse

Methods included from EnvironmentVariable

included, #minimum_grammar_for_emitting_input, #minimum_grammar_for_publishing

Methods inherited from Fig::Statement

#is_asset?, #minimum_grammar_for_emitting_input, #minimum_grammar_for_publishing, position_description, #position_string, #urls, #walk_statements

Constructor Details

#initialize(line_column, source_description, name, tokenized_value) ⇒ Set

Returns a new instance of Set.



23
24
25
26
27
28
# File 'lib/fig/statement/set.rb', line 23

def initialize(line_column, source_description, name, tokenized_value)
  super(line_column, source_description)

  @name = name
  @tokenized_value = tokenized_value
end

Class Method Details

.parse_name_value(combined, &error_block) ⇒ Object

Yields on error.



11
12
13
14
15
# File 'lib/fig/statement/set.rb', line 11

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

  return [variable, tokenize_value(raw_value, &error_block)]
end

.parse_v0_name_value(combined, &error_block) ⇒ Object



17
18
19
20
21
# File 'lib/fig/statement/set.rb', line 17

def self.parse_v0_name_value(combined, &error_block)
  variable, raw_value = seperate_name_and_value combined, &error_block
  base_v0_value_validation(variable, raw_value, &error_block)
  return [variable, tokenize_value(raw_value, &error_block)]
end

Instance Method Details

#deparse_as_version(deparser) ⇒ Object



38
39
40
# File 'lib/fig/statement/set.rb', line 38

def deparse_as_version(deparser)
  return deparser.set(self)
end

#is_environment_variable?Boolean

Returns:

  • (Boolean)


34
35
36
# File 'lib/fig/statement/set.rb', line 34

def is_environment_variable?()
  return true
end

#statement_typeObject



30
31
32
# File 'lib/fig/statement/set.rb', line 30

def statement_type()
  return 'set'
end