Class: Crystalball::Rails::TablesMap
- Inherits:
-
Object
- Object
- Crystalball::Rails::TablesMap
- Extended by:
- Forwardable
- Defined in:
- lib/crystalball/rails/tables_map.rb
Overview
Storage for tables map
Defined Under Namespace
Classes: Metadata
Instance Attribute Summary collapse
-
#example_groups ⇒ Object
readonly
Returns the value of attribute example_groups.
-
#metadata ⇒ Object
readonly
Returns the value of attribute metadata.
Instance Method Summary collapse
- #add(files:, for_table:) ⇒ Object
-
#clear! ⇒ Object
Remove all example_groups.
-
#initialize(metadata: {}, example_groups: {}) ⇒ TablesMap
constructor
A new instance of TablesMap.
Constructor Details
Instance Attribute Details
#example_groups ⇒ Object
Returns the value of attribute example_groups.
25 26 27 |
# File 'lib/crystalball/rails/tables_map.rb', line 25 def example_groups @example_groups end |
#metadata ⇒ Object
Returns the value of attribute metadata.
25 26 27 |
# File 'lib/crystalball/rails/tables_map.rb', line 25 def @metadata end |
Instance Method Details
#add(files:, for_table:) ⇒ Object
42 43 44 45 46 |
# File 'lib/crystalball/rails/tables_map.rb', line 42 def add(files:, for_table:) example_groups[for_table] ||= [] example_groups[for_table] += files example_groups[for_table].uniq! end |
#clear! ⇒ Object
Remove all example_groups
38 39 40 |
# File 'lib/crystalball/rails/tables_map.rb', line 38 def clear! self.example_groups = {} end |