gleborator 0.1.1.2 → 0.1.1.3

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: cc282fef351346cd79ae182952dbb00375c96204
4
- data.tar.gz: f941be218a96c0c6dbb435276987fe649e419faa
3
+ metadata.gz: b66fa368f8cc815753803bcc4e346fd350d96bd6
4
+ data.tar.gz: 7bbf04a52fe87cf3dec71ef59713065a167972c4
5
5
  SHA512:
6
- metadata.gz: 65c2657fef9b111f997d8dad01e68d6ccecff1cdcfb7ddf2c874a6a6fb13005175995ae4af6df510462fc40d0df4f8c71ca337622e813de4f4ea206807ae5835
7
- data.tar.gz: 1b82177e9dd05280fd0f96d78f69502f7eb171de967efc434b8dd300e699d0b963104e681e7e4a07c520273105245260752c9b826d67f3721bfec2f460c575a6
6
+ metadata.gz: 5cb7f351d4d4153f3c8b841c71bfb3058efcf6dfc1a29ee86d5af609f77909908e1841786c81ca9ed80b499e3439fb7965d1e9330cf0bf9c43746357a58f5809
7
+ data.tar.gz: 68729471e40dce840872d1a17743869f9d5d830155e54a1291766b3d528514ff5786cb4c20315b521541764c337fd80f5b59146af36d954c4d8a57596fbc2f2e
@@ -4,12 +4,8 @@ module Gleborator
4
4
  @object = object
5
5
  end
6
6
 
7
- def self.wrap(object)
8
- if object.respond_to? :map
9
-
10
- else
11
- new(object)
12
- end
7
+ def self.decorate_collection(collection)
8
+ collection.map {|object| new(object) }
13
9
  end
14
10
  end
15
11
  end
@@ -5,7 +5,7 @@ module Gleborator
5
5
  def decorate
6
6
  begin
7
7
  decorator_class = "#{self.class.name}Decorator".constantize
8
- decorator_class.wrap(self)
8
+ decorator_class.new(self)
9
9
  rescue NameError => e
10
10
  raise "Couldn't find decorator #{self.class.name}Decorator"
11
11
  end
@@ -13,7 +13,12 @@ module Gleborator
13
13
 
14
14
  module ClassMethods
15
15
  def decorate
16
- raise 'asdfasdfadsf'
16
+ begin
17
+ decorator_class = "#{self.class.name}Decorator".constantize
18
+ decorate_class.decorate_collection(self)
19
+ rescue NameError => e
20
+ raise "Couldn't find decorator #{self.class.name}Decorator"
21
+ end
17
22
  end
18
23
  end
19
24
  end
@@ -1,3 +1,3 @@
1
1
  module Gleborator
2
- VERSION = "0.1.1.2"
2
+ VERSION = "0.1.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gleborator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1.2
4
+ version: 0.1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gleb Vishnevsky