display_case 0.0.9 → 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -22,7 +22,7 @@ module DisplayCase
22
22
  end
23
23
  private_class_method :exhibit_enum
24
24
 
25
- exhibit_query :[], :fetch, :slice, :values_at, :last
25
+ exhibit_query :[], :fetch, :slice, :values_at, :last, :pop
26
26
  exhibit_enum :select, :grep, :reject, :to_enum, :sort, :sort_by, :reverse
27
27
  exhibit_enum :partition do |result|
28
28
  result.map{|group| exhibit(group)}
@@ -43,7 +43,7 @@ module DisplayCase
43
43
  # `render '...', :collection => self` will call #to_ary on this
44
44
  # before rendering, so we need to be prepared.
45
45
  def to_ary
46
- self
46
+ self.to_a
47
47
  end
48
48
 
49
49
  # See https://github.com/objects-on-rails/display-case/issues/27
@@ -51,9 +51,9 @@ module DisplayCase
51
51
  as_json.to_json
52
52
  end
53
53
 
54
- def render(template)
54
+ def render(template, options = {})
55
55
  inject(ActiveSupport::SafeBuffer.new) { |output,element|
56
- output << element.render(template)
56
+ output << element.render(template, options)
57
57
  }
58
58
  end
59
59
 
@@ -150,8 +150,8 @@ module DisplayCase
150
150
  "#{inspect_exhibits}(#{__getobj__.inspect})"
151
151
  end
152
152
 
153
- def render(template)
154
- template.render(:partial => to_partial_path, :object => self)
153
+ def render(template, options = {})
154
+ template.render(options.reverse_merge(:partial => to_partial_path, :object => self))
155
155
  end
156
156
 
157
157
  def exhibited?
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: display_case
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.9
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-22 00:00:00.000000000Z
12
+ date: 2014-03-08 00:00:00.000000000Z
13
13
  dependencies: []
14
14
  description: An implementation of the Exhibit pattern, as described in Objects on
15
15
  Rails