lib/usps/api/templates/method.erb in usps-ruby-client-0.1.0 vs lib/usps/api/templates/method.erb in usps-ruby-client-0.1.1
- old
+ new
@@ -4,21 +4,17 @@
module Usps
module Api
module Endpoints
module <%= data[:group].camelize %>
- #
- # <%= data[:title] %>
- #
<% data[:description].to_s.split("\r").each do |line| %>
# <%= line.strip %>
<% end %>
- #
+ # @param [Hash] options
+ # @option options [required, Hash] <%= data[:request_descriptions].first[1][:name].underscore %> <%= data[:request_descriptions].first[1][:description] %>
<% data[:request_descriptions].each do |option_name, option| %>
-<%= Erubis::Eruby.new(File.read('lib/usps/api/templates/_options.erb')).result(option: option, parents: [], indentation: 0, static_indentation: 3) %><% end %>
- #
- # @see <%= data[:link] %>
- def <%= data[:group].underscore %>(options = {})
+ <% option[:children].each do |child_option_name, child_option| %>
+<%= Erubis::Eruby.new(File.read('lib/usps/api/templates/_options.erb')).result(option: child_option, parents: [], indentation: 0, static_indentation: 3) %><% end %><% end %>def <%= data[:group].underscore %>(options = {})
<% data[:request_descriptions].select{|n,o| o[:required]}.each do |option_name, option| %>
<%= Erubis::Eruby.new(File.read('lib/usps/api/templates/_throw_argument_error.erb')).result(option: option, parents: [], indentation: 3) %>
<% end %>
request = build_request(:<%= data[:group].underscore %>, options)
get('<%= data[:url] %>', {