lib/tokyo_api/base.rb in tokyo_api-0.6.1 vs lib/tokyo_api/base.rb in tokyo_api-1.0.1

- old
+ new

@@ -1,7 +1,19 @@ module TokyoApi class Base < Vertebrae::Model def normalized_base_path "#{base_path}/" end + + def url_escape(string) + CGI.escape(string) + end + + def required_fields_param(required_fields) + if required_fields.present? + "required_fields=#{required_fields.collect{|v| url_escape(v.to_s)}.join(',')}" + else + '' + end + end end end \ No newline at end of file