deckorator 0.1.1 → 0.1.2
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f6f276d78f7021570730acaa579b91dc36d1504e
|
4
|
+
data.tar.gz: 3cb3e00ae2d140b337582bfb9d1a0a9c21b95971
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 53808134be2ef400c3307160877b5f5f6818aebef481443fbdb93212dbb2c25b48b68355ab274d7b3eb4e71916453b43f817fe381fa9c2f8761a616aeb0e2338
|
7
|
+
data.tar.gz: aceecc5972d941bb0e493df6171d783b294c8c07bbe48b703e0b85c578c5ff9ec0e8892191824241f433a86220b21365d1600cc09c8455ac573582a394f53b90
|
data/LICENSE.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
The MIT License (MIT)
|
2
2
|
|
3
|
-
Copyright (c)
|
3
|
+
Copyright (c) John Otander, Jake Mays
|
4
4
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
6
|
of this software and associated documentation files (the "Software"), to deal
|
data/lib/deckorator.rb
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
require 'deckorator/version'
|
2
2
|
require 'deckorator/delegator'
|
3
3
|
require 'deckorator/finder'
|
4
|
+
require 'deckorator/undecorator'
|
4
5
|
require 'active_support/concern'
|
5
6
|
|
6
7
|
module Deckorator
|
@@ -21,14 +22,18 @@ module Deckorator
|
|
21
22
|
end
|
22
23
|
|
23
24
|
included do
|
24
|
-
helper_method :decorate if respond_to?(:helper_method)
|
25
|
-
hide_action :decorate if respond_to?(:hide_action)
|
25
|
+
helper_method :decorate, :undecorate if respond_to?(:helper_method)
|
26
|
+
hide_action :decorate, :undecorate if respond_to?(:hide_action)
|
26
27
|
end
|
27
28
|
|
28
29
|
def decorate(record)
|
29
30
|
Deckorator.decorate(record)
|
30
31
|
end
|
31
32
|
|
33
|
+
def undecorate(decorated_record)
|
34
|
+
decorated_record.try(:decorated_object)
|
35
|
+
end
|
36
|
+
|
32
37
|
private
|
33
38
|
|
34
39
|
def self.decorate_object(record)
|
data/lib/deckorator/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: deckorator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- John Otander
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: exe
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-02-
|
12
|
+
date: 2016-02-17 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -103,6 +103,7 @@ files:
|
|
103
103
|
- lib/deckorator.rb
|
104
104
|
- lib/deckorator/delegator.rb
|
105
105
|
- lib/deckorator/finder.rb
|
106
|
+
- lib/deckorator/undecorator.rb
|
106
107
|
- lib/deckorator/version.rb
|
107
108
|
- lib/generators/deckorator/decorator/USAGE
|
108
109
|
- lib/generators/deckorator/decorator/decorator_generator.rb
|
@@ -131,7 +132,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
131
132
|
version: '0'
|
132
133
|
requirements: []
|
133
134
|
rubyforge_project:
|
134
|
-
rubygems_version: 2.
|
135
|
+
rubygems_version: 2.5.1
|
135
136
|
signing_key:
|
136
137
|
specification_version: 4
|
137
138
|
summary: Lightweight decorators using plain old Ruby objects.
|