lib/cuba_api/accept_content.rb in cuba-api-0.1.0 vs lib/cuba_api/accept_content.rb in cuba-api-0.2.0
- old
+ new
@@ -29,10 +29,13 @@
:xml => ['application/xml'] }
def accept( *args )
args.each do |arg|
(MIMES[ arg ] || []).each do |mime|
+ if arg == :yaml
+ require 'safe_yaml' unless defined?( YAML )
+ end
mimes[ mime ] = "to_#{arg}".to_sym
end
end
warn "[CubaAPI] Accept: #{mimes.keys.join(', ')}"
end
@@ -66,6 +69,6 @@
def self.included( base )
base.append_aspect :accept_content
end
end
-end
\ No newline at end of file
+end