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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f3f4bc7970a2e0c189c495a1f6e9cb73c1fc6d42
4
- data.tar.gz: ae873620f143866e55562ff2e858aca981a658fd
3
+ metadata.gz: c4197c612414df56cf0048a7f5b1e8ba8dd6a960
4
+ data.tar.gz: 67a9607aa14aca8691f25b94b92857f8ca28e4b6
5
5
  SHA512:
6
- metadata.gz: 9e68c78adbc739553ce6db7ad0799d65cced4058a0a8cc4d56c7286e17bd9f01cd744574b19ce8731f3d17e54ebd7c3eb4c8fbd1ceab87f34933aad5daeabde1
7
- data.tar.gz: 774ab9e8b8824bea7803e171a73549080d25812285f9aa2dad45f4c0eb15286e2056de52850d91dcbeff4eee80b9e3a8612e789928aa7daf42e678495fae8d50
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
@@ -1,6 +1,6 @@
1
1
  module Sinatra
2
2
  module Decorator
3
- VERSION = '0.1.1' unless defined?(Sinatra::Decorator::VERSION)
3
+ VERSION = '0.2.0' unless defined?(Sinatra::Decorator::VERSION)
4
4
 
5
5
  def self.version
6
6
  VERSION
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.1.1
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: 2014-09-01 00:00:00.000000000 Z
11
+ date: 2015-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport