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 +4 -4
- data/lib/action_widget/base.rb +5 -0
- data/lib/action_widget/version.rb +1 -1
- data/lib/action_widget/view_helper.rb +3 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 07808bff8dbfd4db751ce2a37bf217694fc86fc2
|
4
|
+
data.tar.gz: 654676cf8cc26a82c4a0352ff2d64f19d0f866c5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b7978810a990ed931e353c5558a1ed80ff7fc0ffb24c126f7284aa59c1c2f3130a3d756a6dd22316b295c666853ef8fd94cd9843a8a778a9a99a42c2e14b850e
|
7
|
+
data.tar.gz: 5affa9d5a48b0d771d83c6e1643f3e96784c13bc188900023cdf0410d1537969caa820003600eb1521a86866d0780bcddc6646975cf0da81b74abb83e557067a
|
data/lib/action_widget/base.rb
CHANGED
@@ -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) }
|
@@ -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)
|
9
|
-
|
10
|
-
|
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.
|
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-
|
11
|
+
date: 2015-11-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: smart_properties
|