rspec/rules/S1700/swift/rule.adoc
2022-02-04 16:28:24 +00:00

49 lines
623 B
Plaintext

include::../description.adoc[]
== Noncompliant Code Example
[source,swift]
----
public class Foo {
private var foo : String
public func getFoo() -> String {
return foo
}
//...
}
var foo = Foo()
foo.getFoo() // what does this return?
----
== Compliant Solution
[source,swift]
----
public class Foo {
private var name : String
public func getName() -> String {
return name
}
//...
}
var foo = Foo();
foo.getName()
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
include::../message.adoc[]
endif::env-github,rspecator-view[]