Sha256: 7cf6d511ab228c15cd389db96459889de2742ded184a47f906c28b5b5ccdf2d5

Contents?: true

Size: 811 Bytes

Versions: 15

Compression:

Stored size: 811 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

15 entries across 15 versions & 1 rubygems

Version Path
reek-4.0.0.pre1 docs/Attribute.md
reek-3.11 docs/Attribute.md
reek-3.10.2 docs/Attribute.md
reek-3.10.1 docs/Attribute.md
reek-3.10.0 docs/Attribute.md
reek-3.9.1 docs/Attribute.md
reek-3.9.0 docs/Attribute.md
reek-3.8.3 docs/Attribute.md
reek-3.8.2 docs/Attribute.md
reek-3.8.1 docs/Attribute.md
reek-3.8.0 docs/Attribute.md
reek-3.7.1 docs/Attribute.md
reek-3.7.0 docs/Attribute.md
reek-3.6.1 docs/Attribute.md
reek-3.6.0 docs/Attribute.md