presenter_object 0.2.8 → 0.2.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -1
- data/lib/presenter_object/base.rb +3 -3
- data/lib/presenter_object/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bca543507de282711d31da1e5b3d83c3a85974c1
|
4
|
+
data.tar.gz: a2ec64d7de23bf0c5a7ae77c88eb70d968e62c17
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 523a3f56b7b6f59282b16add066b8b237b1b50d19e03b4a9c50f8dd0e9256087030629ec5dd073418f624a15913033d7243cc5bbd459d3d9f3fd59fed4e9c654
|
7
|
+
data.tar.gz: 3e6450b2fe28c795565edf805007e4569ca1276431eda52228d5fb7ae7db7cd15ce8638098749132eb09be11a229eb33ca847480ac8efb5051188dfabd32a25e
|
data/.gitignore
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# Presenter superclass. Create your own presenter by sub-classing `PresenterObject::Base`
|
2
|
-
# and declaring the name of the model it will present.
|
2
|
+
# and declaring the name of the model it will present.
|
3
3
|
#
|
4
4
|
# e.g:
|
5
5
|
#
|
@@ -11,7 +11,7 @@
|
|
11
11
|
#
|
12
12
|
# Create a presenter instance by giving it a model instance e.g:
|
13
13
|
#
|
14
|
-
# document = DocumentPresenter.new Document.find(params[:id])
|
14
|
+
# document = DocumentPresenter.new Document.find(params[:id])
|
15
15
|
# document.sender # can call any document model methods...
|
16
16
|
# document.pretty_sender # ...as well as any presenter defined method
|
17
17
|
# document.class # is the wrapped object's class, helps it behave like models do in forms, link helpers etc.
|
@@ -38,7 +38,7 @@ class PresenterObject::Base
|
|
38
38
|
def initialize(object, view_context = nil)
|
39
39
|
@object = object
|
40
40
|
@class = object.class # impersonate object's class
|
41
|
-
@to_param = object.id # let link helpers know the object's id
|
41
|
+
@to_param = object.id if object.respond_to? :id # let link helpers know the object's id if it has one
|
42
42
|
@view_context = view_context
|
43
43
|
end
|
44
44
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: presenter_object
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Diego Salazar
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-03-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -108,7 +108,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
108
108
|
version: '0'
|
109
109
|
requirements: []
|
110
110
|
rubyforge_project:
|
111
|
-
rubygems_version: 2.6.
|
111
|
+
rubygems_version: 2.6.13
|
112
112
|
signing_key:
|
113
113
|
specification_version: 4
|
114
114
|
summary: Prsenter object base class.
|