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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 861ce4bffdeb867fbe39992c13e21f82ab1ca2de
4
- data.tar.gz: 209728c74032a3eb45e6b39be79bd9c96c5a9f00
3
+ metadata.gz: bca543507de282711d31da1e5b3d83c3a85974c1
4
+ data.tar.gz: a2ec64d7de23bf0c5a7ae77c88eb70d968e62c17
5
5
  SHA512:
6
- metadata.gz: e92da814c3af4b730ecbf73ceb7a4e5ebcf3c0e995216260da98a1b3d6891c9ce1389df1d570ca266d10e6735e30f4f5bb55973a1f3020159b71a79cb8e58bb7
7
- data.tar.gz: 6d677452b48a23175e120833dd3ad19ea8db99371f6bb676795f828cb5e66b387c11e1aec4cc31ddea9132c3b09c189777c25e83096e680c32874aa0f5fef657
6
+ metadata.gz: 523a3f56b7b6f59282b16add066b8b237b1b50d19e03b4a9c50f8dd0e9256087030629ec5dd073418f624a15913033d7243cc5bbd459d3d9f3fd59fed4e9c654
7
+ data.tar.gz: 3e6450b2fe28c795565edf805007e4569ca1276431eda52228d5fb7ae7db7cd15ce8638098749132eb09be11a229eb33ca847480ac8efb5051188dfabd32a25e
data/.gitignore CHANGED
@@ -7,4 +7,5 @@
7
7
  /pkg/
8
8
  /spec/reports/
9
9
  /tmp/
10
- *.gem
10
+ *.gem
11
+ codealike.json
@@ -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
@@ -1,3 +1,3 @@
1
1
  module PresenterObject
2
- VERSION = "0.2.8"
2
+ VERSION = "0.2.9"
3
3
  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.8
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: 2017-01-09 00:00:00.000000000 Z
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.7
111
+ rubygems_version: 2.6.13
112
112
  signing_key:
113
113
  specification_version: 4
114
114
  summary: Prsenter object base class.