Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/elcuervo/dec


https://github.com/elcuervo/dec

Last synced: about 1 month ago
JSON representation

Awesome Lists containing this project

README

        

# dec
_simple method decorator_

## Installation

`gem install dec`

## Example

```ruby
class Something
extend Dec

dec { |r| r + 2 }
dec { |r| r + 1 }
def one
1
end

LOG = -> (r) { puts r.upcase; r }

dec LOG
def two
"two"
end
end

s = Something.new
s.one
# => 4

s.two
TWO
# => "two"
```