Class: Reviewer::Command::String::Env
- Inherits:
-
Object
- Object
- Reviewer::Command::String::Env
- Defined in:
- lib/reviewer/command/string/env.rb
Overview
Assembles tool environment variables into a single string or array
Instance Attribute Summary collapse
-
#env_pairs ⇒ Object
readonly
Returns the value of attribute env_pairs.
Instance Method Summary collapse
-
#initialize(env_pairs) ⇒ self
constructor
Creates an instance of env variables for a tool to help generate the command string.
- #to_a ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(env_pairs) ⇒ self
Creates an instance of env variables for a tool to help generate the command string
14 15 16 |
# File 'lib/reviewer/command/string/env.rb', line 14 def initialize(env_pairs) @env_pairs = env_pairs end |
Instance Attribute Details
#env_pairs ⇒ Object (readonly)
Returns the value of attribute env_pairs.
8 9 10 |
# File 'lib/reviewer/command/string/env.rb', line 8 def env_pairs @env_pairs end |
Instance Method Details
#to_a ⇒ Object
22 23 24 25 26 |
# File 'lib/reviewer/command/string/env.rb', line 22 def to_a env = [] env_pairs.each { |key, value| env << env(key, value) } env end |
#to_s ⇒ Object
18 19 20 |
# File 'lib/reviewer/command/string/env.rb', line 18 def to_s to_a.compact.join(' ') end |