showcase 0.1.2 → 0.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: c765d3877ec138551a3f31f9689b060b8461a433
4
- data.tar.gz: 59dcf8ad2c8b36965df56f5edb950beed2ddcfc8
3
+ metadata.gz: c2dac659595ecfefe450c2e7b15134928cfb092f
4
+ data.tar.gz: 894b2b499088e50f4c1d6928ae318935678048b1
5
5
  SHA512:
6
- metadata.gz: db97e02df789e59db7f735b2414ebcdb469dcca9de3323ab36598556bd77802ed56c15f3f93658aabf9b04f8c1208699405db96a5011a992f9296c334ef26219
7
- data.tar.gz: 7b23bfa80dd5a1c5ac4968c8704f8260cb7d4c5a845ddef8e1fc8579f5ec4bb7dd19f362c956698573b60fc43a0b3a2c1ab76b8d8510c6f85455533dcd585f49
6
+ metadata.gz: ede80b6f7826d8899ae55dfc64ed0c651ec2f7f1fb8b694cf93520299b02992bc5e87f0761a3797feb066105a1ab754af8f1b9aa90af6b8ef352f5b9e59eb778
7
+ data.tar.gz: 6b2faaa1ad5d27333be12c34748da6263ff18ed61305ecc47d7289453a4d968f42910f70a3bd41f739aec30d1701dede0cec2bb3591a7d8ce27e99771832ad90
@@ -2,28 +2,30 @@ require 'delegate'
2
2
  require 'showcase/helpers'
3
3
 
4
4
  module Showcase
5
- class Presenter < BasicObject
5
+ class Presenter < SimpleDelegator
6
+ include Helpers
7
+
6
8
  attr_reader :view_context
7
- attr_reader :object
8
- alias_method :h, :view_context
9
9
 
10
- include Helpers
10
+ alias_method :object, :__getobj__
11
+ alias_method :h, :view_context
11
12
 
12
- def initialize(object, context)
13
- @object = object
13
+ def initialize(obj, context)
14
+ super(obj)
14
15
  @view_context = context
15
16
  end
16
17
 
17
- def respond_to?(name)
18
- if [:view_context, :h, :object].include? name
19
- true
20
- else
21
- object.respond_to?(name)
22
- end
18
+ def class
19
+ object.class
20
+ end
21
+
22
+ def kind_of?(klass)
23
+ object.kind_of?(klass)
23
24
  end
25
+ alias_method :is_a?, :kind_of?
24
26
 
25
- def method_missing(name, *args, &block)
26
- object.__send__(name, *args, &block)
27
+ def instance_of?(klass)
28
+ object.instance_of?(klass)
27
29
  end
28
30
 
29
31
  def self.presents(*attrs)
@@ -1,3 +1,3 @@
1
1
  module Showcase
2
- VERSION = "0.1.2"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: showcase
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stefano Verna