rspec/rules/S1481/ruby/rule.adoc

42 lines
653 B
Plaintext
Raw Normal View History

include::../rationale.adoc[]
include::../how-to-fix-it.adoc[]
=== Code examples
==== Noncompliant code example
[source,ruby,diff-id=1,diff-type=noncompliant]
----
def number_of_minutes(hours)
seconds = 0 # Noncompliant - seconds is unused
hours * 60
end
----
==== Compliant solution
[source,ruby,diff-id=1,diff-type=compliant]
----
def number_of_minutes(hours)
hours * 60
end
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]