sinatra-decorator 0.1.1 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/sinatra/decorator/decoratable.rb +2 -1
- data/lib/sinatra/decorator/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c4197c612414df56cf0048a7f5b1e8ba8dd6a960
|
4
|
+
data.tar.gz: 67a9607aa14aca8691f25b94b92857f8ca28e4b6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2fced29f7c22d871851cc0079b4a11d81ea32d5deffed2d2a0a1669089ae96b5358b7610d5113403f80bc919393a7deac58339dd162a3a5b3b51d036e0fe30e9
|
7
|
+
data.tar.gz: c685481d04d2d587086f7d21cbc29ea01ead9aa5c5bb06f46c5ab418a885dc1cef45fa75c78afbfeea53fc482373c641701cb2a3631d32f1e3eca7bf4f885c5a
|
@@ -2,6 +2,7 @@ module Sinatra
|
|
2
2
|
module Decorator
|
3
3
|
module Decoratable
|
4
4
|
def decorate(options = {})
|
5
|
+
return @decorator if @decorator
|
5
6
|
|
6
7
|
klass = options[:as]
|
7
8
|
klass_name = "#{self.class}Decorator"
|
@@ -9,7 +10,7 @@ module Sinatra
|
|
9
10
|
decorator = klass.new(self, context: self)
|
10
11
|
|
11
12
|
yield decorator if block_given?
|
12
|
-
decorator
|
13
|
+
@decorator = decorator
|
13
14
|
end
|
14
15
|
end # Decoratable
|
15
16
|
end # Decorator
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: sinatra-decorator
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Naotoshi Seo
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2015-09-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|