Permalink
Browse files

2007-03-21 Laurent Sansonetti <lsansonetti@apple.com>

    * src/lib/rbosa.rb:
    Allow multiple enum values to be passed into the same argument, packing
    then in an array.


git-svn-id: http://rubyosa.rubyforge.org/svn/trunk@190 0d7f026f-1217-0410-b43a-e108cceea134
  • Loading branch information...
1 parent f7586ff commit 40fe0ceda394e0572f6e96b921c9b129b759fd70 @lrz lrz committed Mar 20, 2007
Showing with 12 additions and 1 deletion.
  1. +6 −0 ChangeLog
  2. +6 −1 src/lib/rbosa.rb
View
@@ -1,3 +1,9 @@
+2007-03-21 Laurent Sansonetti <lsansonetti@apple.com>
+
+ * src/lib/rbosa.rb:
+ Allow multiple enum values to be passed into the same argument, packing
+ then in an array.
+
2007-03-18 Laurent Sansonetti <lsansonetti@apple.com>
* tests/tc_itunes.rb,
View
@@ -371,7 +371,12 @@ def self.__convert_to_osa__(requested_type, value, enum_group_codes=nil)
args = [value, requested_type]
conversion.call(*args[0..(conversion.arity - 1)])
elsif enum_group_codes and enum_group_codes.include?(requested_type)
- ['enum', value.code.to_4cc]
+ if value.is_a?(Array)
+ ary = value.map { |x| OSA::Element.__new__('enum', x.code.to_4cc) }
+ ElementList.__new__(ary)
+ else
+ ['enum', value.code.to_4cc]
+ end
elsif md = /^list_of_(.+)$/.match(requested_type)
ary = value.to_a.map do |elem|
obj = convert_to_osa(md[1], elem, enum_group_codes)

0 comments on commit 40fe0ce

Please sign in to comment.