class Figobox::CommandCompiler

Public Class Methods

new(target_alias, variables) click to toggle source
# File lib/figobox/command_compiler.rb, line 3
def initialize(target_alias, variables)
  @alias = target_alias
  @variables = variables || {}
end

Public Instance Methods

add() click to toggle source
# File lib/figobox/command_compiler.rb, line 8
def add
  add_command || ""
end

Private Instance Methods

add_command() click to toggle source
# File lib/figobox/command_compiler.rb, line 14
def add_command
  return unless @variables.any?

  command = "nanobox evar add #{@alias}"
  @variables.each { |k, v| command << " #{k}=#{v}" }

  command
end