Class: Dropkiq::DropMethodInstanceSimulator
- Inherits:
-
Object
- Object
- Dropkiq::DropMethodInstanceSimulator
- Defined in:
- lib/dropkiq/drop_method_instance_simulator.rb
Instance Attribute Summary collapse
-
#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.
-
#sample_drop ⇒ Object
Returns the value of attribute sample_drop.
Instance Method Summary collapse
- #classify ⇒ Object
-
#initialize(drop_method, sample_drop = nil) ⇒ DropMethodInstanceSimulator
constructor
A new instance of DropMethodInstanceSimulator.
Constructor Details
#initialize(drop_method, sample_drop = nil) ⇒ DropMethodInstanceSimulator
Returns a new instance of DropMethodInstanceSimulator.
6 7 8 9 |
# File 'lib/dropkiq/drop_method_instance_simulator.rb', line 6 def initialize(drop_method, sample_drop=nil) self.drop_method = drop_method.to_s self.sample_drop = sample_drop end |
Instance Attribute Details
#drop_method ⇒ Object
Returns the value of attribute drop_method.
3 4 5 |
# File 'lib/dropkiq/drop_method_instance_simulator.rb', line 3 def drop_method @drop_method end |
#dropkiq_type ⇒ Object
Returns the value of attribute dropkiq_type.
4 5 6 |
# File 'lib/dropkiq/drop_method_instance_simulator.rb', line 4 def dropkiq_type @dropkiq_type end |
#foreign_table_name ⇒ Object
Returns the value of attribute foreign_table_name.
4 5 6 |
# File 'lib/dropkiq/drop_method_instance_simulator.rb', line 4 def foreign_table_name @foreign_table_name end |
#sample_drop ⇒ Object
Returns the value of attribute sample_drop.
3 4 5 |
# File 'lib/dropkiq/drop_method_instance_simulator.rb', line 3 def sample_drop @sample_drop end |
Instance Method Details
#classify ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/dropkiq/drop_method_instance_simulator.rb', line 11 def classify value = begin sample_drop.try(drop_method) rescue end self.dropkiq_type = ruby_data_type_to_dropkiq_type(value) self.dropkiq_type ||= test_for_relationship(value) self end |