Class: Gitlab::ImportExport::AttributesFinder
- Inherits:
-
Object
- Object
- Gitlab::ImportExport::AttributesFinder
- Defined in:
- lib/gitlab/import_export/attributes_finder.rb
Instance Attribute Summary collapse
-
#excluded_attributes ⇒ Object
readonly
Returns the value of attribute excluded_attributes.
-
#included_attributes ⇒ Object
readonly
Returns the value of attribute included_attributes.
-
#methods ⇒ Object
readonly
Returns the value of attribute methods.
-
#preloads ⇒ Object
readonly
Returns the value of attribute preloads.
-
#tree ⇒ Object
readonly
Returns the value of attribute tree.
Instance Method Summary collapse
- #find_excluded_keys(klass_name) ⇒ Object
- #find_relations_tree(model_key) ⇒ Object
- #find_root(model_key) ⇒ Object
-
#initialize(config:) ⇒ AttributesFinder
constructor
A new instance of AttributesFinder.
Constructor Details
#initialize(config:) ⇒ AttributesFinder
Returns a new instance of AttributesFinder.
8 9 10 11 12 13 14 |
# File 'lib/gitlab/import_export/attributes_finder.rb', line 8 def initialize(config:) @tree = config[:tree] || {} @included_attributes = config[:included_attributes] || {} @excluded_attributes = config[:excluded_attributes] || {} @methods = config[:methods] || {} @preloads = config[:preloads] || {} end |
Instance Attribute Details
#excluded_attributes ⇒ Object (readonly)
Returns the value of attribute excluded_attributes
6 7 8 |
# File 'lib/gitlab/import_export/attributes_finder.rb', line 6 def excluded_attributes @excluded_attributes end |
#included_attributes ⇒ Object (readonly)
Returns the value of attribute included_attributes
6 7 8 |
# File 'lib/gitlab/import_export/attributes_finder.rb', line 6 def included_attributes @included_attributes end |
#methods ⇒ Object (readonly)
Returns the value of attribute methods
6 7 8 |
# File 'lib/gitlab/import_export/attributes_finder.rb', line 6 def methods @methods end |
#preloads ⇒ Object (readonly)
Returns the value of attribute preloads
6 7 8 |
# File 'lib/gitlab/import_export/attributes_finder.rb', line 6 def preloads @preloads end |
#tree ⇒ Object (readonly)
Returns the value of attribute tree
6 7 8 |
# File 'lib/gitlab/import_export/attributes_finder.rb', line 6 def tree @tree end |
Instance Method Details
#find_excluded_keys(klass_name) ⇒ Object
24 25 26 |
# File 'lib/gitlab/import_export/attributes_finder.rb', line 24 def find_excluded_keys(klass_name) @excluded_attributes[klass_name.to_sym]&.map(&:to_s) || [] end |
#find_relations_tree(model_key) ⇒ Object
20 21 22 |
# File 'lib/gitlab/import_export/attributes_finder.rb', line 20 def find_relations_tree(model_key) @tree[model_key] end |
#find_root(model_key) ⇒ Object
16 17 18 |
# File 'lib/gitlab/import_export/attributes_finder.rb', line 16 def find_root(model_key) find(model_key, @tree[model_key]) end |