action_widget 0.6.1 → 0.7.0

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: dba13c5767716e2031d96aef351a03bb32ce2102
4
- data.tar.gz: f7526842c103cf04048e340c4622ede18720779b
3
+ metadata.gz: 07808bff8dbfd4db751ce2a37bf217694fc86fc2
4
+ data.tar.gz: 654676cf8cc26a82c4a0352ff2d64f19d0f866c5
5
5
  SHA512:
6
- metadata.gz: be72bd032fbc25b1acdb4c5d08832e198cacfa5a4c6e19ac2c92306391a8b0e8ad6c2c7c03df7c66d8fcb77798486863d0d8861401eb242dd5106b38f157e739
7
- data.tar.gz: 4e1966a15edf1dc8b1df2f69a6cb3122e7efc9cc21d5edf8e002a7947a0661988123e4c69b8b1eb8755a8fbdbfabcc04d2cc03a0aa25678d637db6ad7b615d91
6
+ metadata.gz: b7978810a990ed931e353c5558a1ed80ff7fc0ffb24c126f7284aa59c1c2f3130a3d756a6dd22316b295c666853ef8fd94cd9843a8a778a9a99a42c2e14b850e
7
+ data.tar.gz: 5affa9d5a48b0d771d83c6e1643f3e96784c13bc188900023cdf0410d1537969caa820003600eb1521a86866d0780bcddc6646975cf0da81b74abb83e557067a
@@ -5,6 +5,11 @@ module ActionWidget
5
5
 
6
6
  attr_reader :options
7
7
 
8
+ def self.render(view, *args, &block)
9
+ attrs = args.last.kind_of?(Hash) ? args.pop : {}
10
+ self.new(view, attrs).render(*args, &block)
11
+ end
12
+
8
13
  def initialize(view, attributes = {})
9
14
  properties = self.class.properties
10
15
  attributes, options = attributes.partition { |name, value| properties.key?(name) }
@@ -1,3 +1,3 @@
1
1
  module ActionWidget
2
- VERSION = '0.6.1'
2
+ VERSION = '0.7.0'
3
3
  end
@@ -5,10 +5,9 @@ module ActionWidget
5
5
  return super if widget.nil?
6
6
 
7
7
  ActionWidget::ViewHelper.module_eval <<-RUBY
8
- def #{name}(*args, &block) # def example_widget(*args, &block)
9
- attrs = args.last.kind_of?(Hash) ? args.pop : {}
10
- #{widget}.new(self, attrs).render(*args, &block) # ExampleWidget.new(self, attrs).render(*args, &block)
11
- end # end
8
+ def #{name}(*args, &block) # def example_widget(*args, &block)
9
+ #{widget}.render(self, *args, &block) # ExampleWidget.render(self, *args, &block)
10
+ end # end
12
11
  RUBY
13
12
 
14
13
  send(name, *args, &block)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: action_widget
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.1
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Konstantin Tennhard
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-10-23 00:00:00.000000000 Z
11
+ date: 2015-11-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: smart_properties