Sha256: 466843ac7ef5aa74ff515796edc966f4332f4969ae26c6dff9265ef66c13de49

Contents?: true

Size: 904 Bytes

Versions: 8

Compression:

Stored size: 904 Bytes

Contents

# Attribute

## Introduction

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

## 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 attribute dummy (Attribute)
```

## Support in Reek

Right now this smell is disabled by default since it is highly subjective.

When this detector is enabled it raises a warning for every `attr`, `attr_reader`, `attr_writer` and `attr_accessor` -- including those that are private.

## Configuration

If you want to enable it you can do so by placing

```yaml
Attribute:
  enabled: true
```

in your reek configuration file.

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
reek-3.1 docs/Attribute.md
reek-3.0.4 docs/Attribute.md
reek-3.0.3 docs/Attribute.md
reek-3.0.2 docs/Attribute.md
reek-3.0.1 docs/Attribute.md
reek-3.0.0 docs/Attribute.md
reek-2.2.1 docs/Attribute.md
reek-2.2.0 docs/Attribute.md