videoclip 0.2.12 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/VERSION +1 -1
  2. data/lib/videoclip.rb +18 -10
  3. data/videoclip.gemspec +1 -1
  4. metadata +1 -1
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.12
1
+ 0.3.0
@@ -9,19 +9,27 @@ module LaserLemon
9
9
  end
10
10
 
11
11
  module ClassMethods
12
- def has_video(name = :video, options = {})
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 = {name.to_sym => options}
18
+ self.videoclip_options ||= {}
19
+
20
+ names.each do |name|
21
+ self.videoclip_options.update(name => options)
15
22
 
16
- composed_of name,
17
- :class_name => 'LaserLemon::Videoclip::Video',
18
- :mapping => %w(host key url).map{|x| %W(#{name}_#{x} #{x}) },
19
- :constructor => Proc.new{|h,k,u| LaserLemon::Videoclip::Video.build(h, k, u, options) },
20
- :converter => Proc.new{|u| LaserLemon::Videoclip::Video.assign(u, options) },
21
- :allow_nil => true
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
- define_method "#{name}?" do
24
- !! send(name)
30
+ define_method "#{name}?" do
31
+ !! send(name)
32
+ end
25
33
  end
26
34
  end
27
35
  end
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{videoclip}
8
- s.version = "0.2.12"
8
+ s.version = "0.3.0"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["laserlemon"]
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: videoclip
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.12
4
+ version: 0.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - laserlemon