videoclip 0.2.12 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/VERSION +1 -1
- data/lib/videoclip.rb +18 -10
- data/videoclip.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.
|
1
|
+
0.3.0
|
data/lib/videoclip.rb
CHANGED
@@ -9,19 +9,27 @@ module LaserLemon
|
|
9
9
|
end
|
10
10
|
|
11
11
|
module ClassMethods
|
12
|
-
def has_video(
|
12
|
+
def has_video(*names)
|
13
|
+
options = names.extract_options!.symbolize_keys
|
14
|
+
names.collect!(&:to_sym)
|
15
|
+
names << :video if names.empty?
|
16
|
+
|
13
17
|
class_inheritable_hash :videoclip_options
|
14
|
-
self.videoclip_options
|
18
|
+
self.videoclip_options ||= {}
|
19
|
+
|
20
|
+
names.each do |name|
|
21
|
+
self.videoclip_options.update(name => options)
|
15
22
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
23
|
+
composed_of name,
|
24
|
+
:class_name => 'LaserLemon::Videoclip::Video',
|
25
|
+
:mapping => %w(host key url).map{|x| %W(#{name}_#{x} #{x}) },
|
26
|
+
:constructor => Proc.new{|h,k,u| LaserLemon::Videoclip::Video.build(h, k, u, options) },
|
27
|
+
:converter => Proc.new{|u| LaserLemon::Videoclip::Video.assign(u, options) },
|
28
|
+
:allow_nil => true
|
22
29
|
|
23
|
-
|
24
|
-
|
30
|
+
define_method "#{name}?" do
|
31
|
+
!! send(name)
|
32
|
+
end
|
25
33
|
end
|
26
34
|
end
|
27
35
|
end
|
data/videoclip.gemspec
CHANGED