class MatrixFormatter::FeatureMatrix

Attributes

current_feature[RW]
current_implementor[RW]
current_product[RW]
implementors[R]
results[R]

Public Class Methods

new() click to toggle source
# File lib/matrix_formatter/feature_matrix.rb, line 7
def initialize
  @implementors = RSpec.configuration.matrix_implementors
  # results[product][feature][implementor]
  @results = Hash.new { |product_hash, product_key|
    product_hash[product_key] = Hash.new { |feature_hash, feature_key|
      feature_hash[feature_key] = Hash.new { |implementor_hash, implementor_key|
        implementor_hash[implementor_key] = Hash.new
      }
    }
  }
end

Public Instance Methods

add_result(state) click to toggle source
# File lib/matrix_formatter/feature_matrix.rb, line 19
def add_result state
  @results[current_product][current_feature][current_implementor] = state
end
to_json() click to toggle source
# File lib/matrix_formatter/feature_matrix.rb, line 23
def to_json
  MultiJson.encode @results
end