class Rototiller::Task::EnvCollection

Public Instance Methods

allowed_class() click to toggle source

@return [Type] allowed class for this collection (EnvVar)

# File lib/rototiller/task/collections/env_collection.rb, line 10
def allowed_class
  EnvVar
end
last() click to toggle source

remove the nils and return the last known value @return [String] last set environment variable or default

# File lib/rototiller/task/collections/env_collection.rb, line 16
def last
  if self.any?
    last_known_env_var = self.map{|x| x.value}.compact.last
    # ruby converts nil to "", so guard against single non-set env vars here
    last_known_env_var.to_s if last_known_env_var
  end
end