Class: Dropkiq::DropMethodAnalyzer
- Inherits:
-
Object
- Object
- Dropkiq::DropMethodAnalyzer
- Defined in:
- lib/dropkiq/drop_method_analyzer.rb
Instance Attribute Summary collapse
-
#drop_class_analyzer ⇒ Object
Returns the value of attribute drop_class_analyzer.
-
#drop_method ⇒ Object
Returns the value of attribute drop_method.
-
#dropkiq_type ⇒ Object
Returns the value of attribute dropkiq_type.
-
#foreign_table_name ⇒ Object
Returns the value of attribute foreign_table_name.
Instance Method Summary collapse
- #analyze ⇒ Object
-
#initialize(drop_class_analyzer, drop_method) ⇒ DropMethodAnalyzer
constructor
A new instance of DropMethodAnalyzer.
- #to_param ⇒ Object
Constructor Details
#initialize(drop_class_analyzer, drop_method) ⇒ DropMethodAnalyzer
Returns a new instance of DropMethodAnalyzer.
8 9 10 11 |
# File 'lib/dropkiq/drop_method_analyzer.rb', line 8 def initialize(drop_class_analyzer, drop_method) self.drop_class_analyzer = drop_class_analyzer self.drop_method = drop_method end |
Instance Attribute Details
#drop_class_analyzer ⇒ Object
Returns the value of attribute drop_class_analyzer.
3 4 5 |
# File 'lib/dropkiq/drop_method_analyzer.rb', line 3 def drop_class_analyzer @drop_class_analyzer end |
#drop_method ⇒ Object
Returns the value of attribute drop_method.
3 4 5 |
# File 'lib/dropkiq/drop_method_analyzer.rb', line 3 def drop_method @drop_method end |
#dropkiq_type ⇒ Object
Returns the value of attribute dropkiq_type.
3 4 5 |
# File 'lib/dropkiq/drop_method_analyzer.rb', line 3 def dropkiq_type @dropkiq_type end |
#foreign_table_name ⇒ Object
Returns the value of attribute foreign_table_name.
3 4 5 |
# File 'lib/dropkiq/drop_method_analyzer.rb', line 3 def foreign_table_name @foreign_table_name end |
Instance Method Details
#analyze ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/dropkiq/drop_method_analyzer.rb', line 13 def analyze self.dropkiq_type = if is_relationship? relationship_to_dropkiq_type_classifier elsif is_column? column_to_dropkiq_type_classifier end end |
#to_param ⇒ Object
21 22 23 24 25 26 27 28 29 30 |
# File 'lib/dropkiq/drop_method_analyzer.rb', line 21 def to_param return {} if dropkiq_type.blank? { "#{drop_method}" => { "type" => dropkiq_type, "foreign_table_name" => foreign_table_name } } end |