presenter_object 0.1.0 → 0.1.1

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: 2b2b81e23c06a961f66b04f603fd5e99dd7c9d19
4
- data.tar.gz: 08f1c1059ad498a3c093acf8d890f2c9c8aaecee
3
+ metadata.gz: 31375ecaeddf2aa9d215d0985271735cfc7eff98
4
+ data.tar.gz: b4e69bdbdb37235b2f7542ce12aece07535d0e30
5
5
  SHA512:
6
- metadata.gz: 6615515a4ffaadb2f993bb7c3acf06dae12060e79ca82c741839d2fb93491c8654a60fa8d3f0a1461097c732bf065612774f0170027d56210ac514128c35c2a5
7
- data.tar.gz: 2cae90ea5004842feb15d9f83735f4e8cf19c2430e3afe9c168a1369a018c993fc8e893c4169e47f41160332399c7524eeec9699de88ed766be8753d8dd2212f
6
+ metadata.gz: 22d91b069467c4a01937bf3ef571888b4cfbce321e670321747d2c309994135e74d0694cd7822719fa328506ac2b1f1ee611f4856ceb92cb89e7f65e94e0effe
7
+ data.tar.gz: c231031737a1051f84a90762ca0cc0bfd1ca32a0c72f6f0b454367224a9a824ada5ecf1868a4f3edb5dcaa861efd66f72fcd768b35b21eef7f5ab242da330f59
@@ -32,18 +32,27 @@ class PresenterObject::Base
32
32
  end
33
33
  end
34
34
 
35
- attr_reader :object, :class
35
+ attr_reader :object, :class, :view_context
36
36
 
37
- def initialize(object)
38
- @object, @class = object, object.class
37
+ def initialize(object, view_context)
38
+ @object, @class, @view_context = object, object.class, view_context
39
39
  end
40
40
 
41
41
  def method_missing(name, *args, &block)
42
- super unless object.respond_to? name
43
- object.send name, *args, &block
42
+ if @object.respond_to? name
43
+ @object.send name, *args, &block
44
+ elsif @view_context.respond_to? name
45
+ @view_context.send name, *args, &block
46
+ else
47
+ super
48
+ end
44
49
  end
45
50
 
46
51
  def respond_to?(name, include_private = false)
47
- object.respond_to? name, include_private or super
52
+ if @object.respond_to?(name, include_private) || @view_context.respond_to?(name, include_private)
53
+ true
54
+ else
55
+ super
56
+ end
48
57
  end
49
- end
58
+ end
@@ -1,3 +1,3 @@
1
1
  module PresenterObject
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: presenter_object
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Diego Salazar