Sha256: c7886cc27788661b630a5b113b00a534f60da7dfb8c50c67f9176ff36f2dad92

Contents?: true

Size: 813 Bytes

Versions: 7

Compression:

Stored size: 813 Bytes

Contents

# Attribute

## Introduction

A class that publishes a setter for an instance variable invites
client classes to become too intimate with its inner workings, and in
particular with its representation of state.

The same holds to a lesser extent for getters, but Reek doesn't flag those.

## Example

Given:

```Ruby
class Klass
  attr_accessor :dummy
end
```

`reek` would emit the following warning:

```
reek test.rb

test.rb -- 1 warning:
  [2]:Klass declares the writable attribute dummy (Attribute)
```

## Support in Reek

This detector it raises a warning for every public `attr_writer`,
`attr_accessor`, and `attr` with the writable flag set to `true`.

Reek does not raise warnings for read-only attributes.

## Configuration

`Attribute` supports only the [Basic Smell Options](Basic-Smell-Options.md).

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
reek-3.5.0 docs/Attribute.md
reek-3.4.1 docs/Attribute.md
reek-3.4.0 docs/Attribute.md
reek-3.3.1 docs/Attribute.md
reek-3.3.0 docs/Attribute.md
reek-3.2.1 docs/Attribute.md
reek-3.2 docs/Attribute.md