decoru 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8886ef6ee47213ebf8d205b17b006e2a7bf3332529683db0373d81ce24fa23f3
4
- data.tar.gz: a16a0e63b1248971cb3dbe09dece5714072d7677b57182932572328a0604c64c
3
+ metadata.gz: 516b0a428cf401d2b92e35ec2863ce4b92e930ce70870c913e36dd89352f34ed
4
+ data.tar.gz: e2ac724b3da0a21e14a9f1ad2b30b42ec651d3ccc81fb2cc54f6afd36a1d8895
5
5
  SHA512:
6
- metadata.gz: 5c14cbe3740c8b40406eca095782a5649cb9fcbf1f7d65b4c6246d16f0c6f8c87671fe5ccb231ad7f4f82893d9ce07996ff36933288b8d6a29f1c1dd17b21f59
7
- data.tar.gz: b5087f1598dabca920cc1692e535edb58196917b76dfcfd9afdea035304f401c53566819ae4c487a8dfdd9eed2f22058627a72170e22b1ff430aa852135e34d3
6
+ metadata.gz: 8fac95dd91122f8c45ef3d26055f74547d80961809e8fc020588e2b84052b543e43f8fc9210190e283bc9f2433040c0bc1e15fef60661178b2b16f395e316866
7
+ data.tar.gz: 550986195dcf4a9609366d4a08db40d6c9feaa1ff8a94abfd86c5ee175060543023533432933d8f898765d6fec114358f37977f19f6a014d542541e9d86c0ab0
data/CHANGELOG.md CHANGED
@@ -1,3 +1,7 @@
1
+ ## 0.1.1
2
+
3
+ - Add decoru alias
4
+
1
5
  ## 0.1.0
2
6
 
3
7
  - First Release
data/README.md CHANGED
@@ -7,11 +7,15 @@ A simple decorator for Rails models.
7
7
  ```ruby
8
8
  # app/controllers/users_controller.rb
9
9
  def show
10
- @user = User.find(params[:id]).decorate
10
+ @user = User.find(params[:id]).decoru
11
+ # or
12
+ # @user = User.find(params[:id]).decorate
11
13
  end
12
14
 
13
15
  def index
14
- @users = User.first(10).decorate
16
+ @users = User.first(10).decoru
17
+ # or
18
+ # @users = User.first(10).decorate
15
19
  end
16
20
  ```
17
21
 
@@ -8,6 +8,8 @@ module Decoru
8
8
  all.map(&:decorate)
9
9
  end
10
10
 
11
+ alias_method :decoru, :decorate
12
+
11
13
  # Infers the decorator class to be used by (e.g. `User` maps to `UserDecorator`).
12
14
  # adapted from https://github.com/drapergem/draper/blob/157eb955072a941e6455e0121fca09a989fcbc21/lib/draper/decoratable.rb#L71
13
15
  def decorator_class(called_on = self)
@@ -27,6 +29,8 @@ module Decoru
27
29
  self.class.decorator_class.new(self)
28
30
  end
29
31
 
32
+ alias_method :decoru, :decorate
33
+
30
34
  def decorated?
31
35
  false
32
36
  end
@@ -1,3 +1,3 @@
1
1
  module Decoru
2
- VERSION = '0.1.0'
2
+ VERSION = '0.1.1'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decoru
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - aki77
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-03-21 00:00:00.000000000 Z
11
+ date: 2020-03-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails