Class: MatrixFormatter::FeatureMatrix
- Inherits:
-
Object
- Object
- MatrixFormatter::FeatureMatrix
- Defined in:
- lib/matrix_formatter/feature_matrix.rb
Instance Attribute Summary collapse
-
#current_feature ⇒ Object
Returns the value of attribute current_feature.
-
#current_implementor ⇒ Object
Returns the value of attribute current_implementor.
-
#current_product ⇒ Object
Returns the value of attribute current_product.
-
#implementors ⇒ Object
readonly
Returns the value of attribute implementors.
-
#results ⇒ Object
readonly
Returns the value of attribute results.
Instance Method Summary collapse
- #add_result(state) ⇒ Object
-
#initialize ⇒ FeatureMatrix
constructor
A new instance of FeatureMatrix.
- #to_json ⇒ Object
Constructor Details
#initialize ⇒ FeatureMatrix
Returns a new instance of FeatureMatrix.
7 8 9 10 11 12 13 14 15 16 17 |
# 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 |
Instance Attribute Details
#current_feature ⇒ Object
Returns the value of attribute current_feature.
3 4 5 |
# File 'lib/matrix_formatter/feature_matrix.rb', line 3 def current_feature @current_feature end |
#current_implementor ⇒ Object
Returns the value of attribute current_implementor.
3 4 5 |
# File 'lib/matrix_formatter/feature_matrix.rb', line 3 def current_implementor @current_implementor end |
#current_product ⇒ Object
Returns the value of attribute current_product.
3 4 5 |
# File 'lib/matrix_formatter/feature_matrix.rb', line 3 def current_product @current_product end |
#implementors ⇒ Object (readonly)
Returns the value of attribute implementors.
4 5 6 |
# File 'lib/matrix_formatter/feature_matrix.rb', line 4 def implementors @implementors end |
#results ⇒ Object (readonly)
Returns the value of attribute results.
5 6 7 |
# File 'lib/matrix_formatter/feature_matrix.rb', line 5 def results @results end |
Instance Method Details
#add_result(state) ⇒ Object
19 20 21 |
# File 'lib/matrix_formatter/feature_matrix.rb', line 19 def add_result state @results[current_product][current_feature][current_implementor] = state end |
#to_json ⇒ Object
23 24 25 |
# File 'lib/matrix_formatter/feature_matrix.rb', line 23 def to_json MultiJson.encode @results end |