Class: Dropkiq::DropMethodNameClassifier

Inherits:
Object
  • Object
show all
Defined in:
lib/dropkiq/drop_method_name_classifier.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(drop_method) ⇒ DropMethodNameClassifier

Returns a new instance of DropMethodNameClassifier.



5
6
7
# File 'lib/dropkiq/drop_method_name_classifier.rb', line 5

def initialize(drop_method)
  self.drop_method = drop_method.to_s
end

Instance Attribute Details

#drop_methodObject

Returns the value of attribute drop_method.



3
4
5
# File 'lib/dropkiq/drop_method_name_classifier.rb', line 3

def drop_method
  @drop_method
end

Instance Method Details

#classifyObject



9
10
11
12
13
14
15
16
17
18
19
# File 'lib/dropkiq/drop_method_name_classifier.rb', line 9

def classify
  if numeric_type_match?
    Dropkiq::NUMERIC_TYPE
  elsif boolean_type_match?
    Dropkiq::BOOLEAN_TYPE
  elsif text_type_match?
    Dropkiq::TEXT_TYPE
  elsif string_type_match?
    Dropkiq::STRING_TYPE
  end
end