Class: RuboCop::Cop::SketchupSuggestions::Compatibility
Constant Summary
collapse
- MSG =
"Incompatible feature with target SketchUp version".freeze
SketchUp::Features::FEATURES, SketchUp::Features::INSTANCE_METHODS, SketchUp::Features::OBSERVER_METHODS
SketchUp::Config::DEFAULT_CONFIGURATION
Instance Method Summary
collapse
inherited, #relevant_file?
Instance Method Details
#on_const(node) ⇒ Object
34
35
36
37
38
39
|
# File 'lib/rubocop/sketchup/cop/suggestions/compatibility.rb', line 34
def on_const(node)
feature_name = node.const_name
[:class, :module, :constant].each { |type|
check_feature(node, type, feature_name)
}
end
|
#on_def(node) ⇒ Object
12
13
14
15
16
|
# File 'lib/rubocop/sketchup/cop/suggestions/compatibility.rb', line 12
def on_def(node)
return unless observer_method?(node)
feature_name = "##{node.method_name}"
check_feature(node, :method, feature_name)
end
|
#on_send(node) ⇒ Object
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
# File 'lib/rubocop/sketchup/cop/suggestions/compatibility.rb', line 18
def on_send(node)
if module_method?(node)
feature_name = "#{node.receiver.const_name}.#{node.method_name}"
check_feature(node, :method, feature_name)
else
return unless checkable_instance_method?(node)
feature_name = "##{node.method_name}"
check_feature(node, :method, feature_name)
end
end
|