motion-pixate-layout 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +1 -1
- data/lib/motion-pixate-layout/proxy.rb +15 -3
- data/lib/motion-pixate-layout/version.rb +1 -1
- metadata +2 -2
data/Gemfile.lock
CHANGED
@@ -64,8 +64,10 @@ module MotionPixateLayout
|
|
64
64
|
subview.styleId = selector.style_id
|
65
65
|
subview.styleClass = selector.style_classes.join(" ")
|
66
66
|
|
67
|
-
attributes.
|
68
|
-
|
67
|
+
unless attributes.nil?
|
68
|
+
attributes.each do |key, value|
|
69
|
+
subview.send "#{key}=", value
|
70
|
+
end
|
69
71
|
end
|
70
72
|
|
71
73
|
view.addSubview subview
|
@@ -78,11 +80,21 @@ module MotionPixateLayout
|
|
78
80
|
end
|
79
81
|
end
|
80
82
|
|
83
|
+
def self.add_subview_method(klass)
|
84
|
+
define_method klass.name do |*args, &block|
|
85
|
+
selector, options, = *args
|
86
|
+
subview klass, selector, options, &block
|
87
|
+
end
|
88
|
+
end
|
89
|
+
|
90
|
+
|
81
91
|
def method_missing(method_name, *args, &block)
|
82
92
|
if Kernel.constants.include?(method_name.to_sym)
|
83
93
|
view_class = Kernel.const_get(method_name.to_s)
|
84
94
|
raise "#{view_class.name} is not a known UIView subclass" unless view_class <= UIView
|
85
|
-
|
95
|
+
self.class.add_subview_method(view_class)
|
96
|
+
|
97
|
+
send method_name, *args, &block
|
86
98
|
else
|
87
99
|
raise "#{method_name} is not defined. Should be a subclass of UIView."
|
88
100
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: motion-pixate-layout
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.6
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2013-06-
|
13
|
+
date: 2013-06-19 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: motion-pixate
|