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 +4 -4
- data/lib/showcase/presenter.rb +16 -14
- data/lib/showcase/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c2dac659595ecfefe450c2e7b15134928cfb092f
|
4
|
+
data.tar.gz: 894b2b499088e50f4c1d6928ae318935678048b1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ede80b6f7826d8899ae55dfc64ed0c651ec2f7f1fb8b694cf93520299b02992bc5e87f0761a3797feb066105a1ab754af8f1b9aa90af6b8ef352f5b9e59eb778
|
7
|
+
data.tar.gz: 6b2faaa1ad5d27333be12c34748da6263ff18ed61305ecc47d7289453a4d968f42910f70a3bd41f739aec30d1701dede0cec2bb3591a7d8ce27e99771832ad90
|
data/lib/showcase/presenter.rb
CHANGED
@@ -2,28 +2,30 @@ require 'delegate'
|
|
2
2
|
require 'showcase/helpers'
|
3
3
|
|
4
4
|
module Showcase
|
5
|
-
class Presenter <
|
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
|
-
|
10
|
+
alias_method :object, :__getobj__
|
11
|
+
alias_method :h, :view_context
|
11
12
|
|
12
|
-
def initialize(
|
13
|
-
|
13
|
+
def initialize(obj, context)
|
14
|
+
super(obj)
|
14
15
|
@view_context = context
|
15
16
|
end
|
16
17
|
|
17
|
-
def
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
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
|
26
|
-
object.
|
27
|
+
def instance_of?(klass)
|
28
|
+
object.instance_of?(klass)
|
27
29
|
end
|
28
30
|
|
29
31
|
def self.presents(*attrs)
|
data/lib/showcase/version.rb
CHANGED