class Vx::Builder::BuildConfiguration::Matrix

Attributes

attributes[R]

Public Class Methods

new(new_env) click to toggle source
# File lib/vx/builder/build_configuration/matrix.rb, line 8
def initialize(new_env)
  normalize_attributes(new_env)
end

Public Instance Methods

exclude() click to toggle source
# File lib/vx/builder/build_configuration/matrix.rb, line 12
def exclude
  @attributes["exclude"] || []
end

Private Instance Methods

extract_exclude(env) click to toggle source
# File lib/vx/builder/build_configuration/matrix.rb, line 27
def extract_exclude(env)
  case env['exclude']
  when Hash
    [env['exclude']]
  when Array
    env['exclude'].select{|i| i.is_a?(Hash) }
  end
end
normalize_attributes(new_env) click to toggle source
# File lib/vx/builder/build_configuration/matrix.rb, line 18
def normalize_attributes(new_env)
  @attributes = {}

  if new_env.is_a?(Hash)
    exclude = extract_exclude(new_env)
    @attributes.merge!("exclude" => exclude) if exclude
  end
end