rspec/rules/S1700/swift/rule.adoc

38 lines
429 B
Plaintext
Raw Normal View History

2020-06-30 12:47:33 +02:00
include::../description.adoc[]
== Noncompliant Code Example
----
public class Foo {
private var foo : String
public func getFoo() -> String {
return foo
}
//...
}
var foo = Foo()
foo.getFoo() // what does this return?
----
== Compliant Solution
----
public class Foo {
private var name : String
public func getName() -> String {
return name
}
//...
}
var foo = Foo();
foo.getName()
----