lib/slack/web/api/templates/method.erb in slack-ruby-client-0.7.0 vs lib/slack/web/api/templates/method.erb in slack-ruby-client-0.7.1
- old
+ new
@@ -2,11 +2,11 @@
module Slack
module Web
module Api
module Endpoints
- module <%= group.capitalize %>
+ module <%= group.gsub(".", "_").camelize %>
<% names.each_with_index do |(name, data), index| %>
<% next if data['mixin'] %>
<% if index > 0 %>
<% end %>
@@ -25,10 +25,10 @@
<% end %>
<% end %>
<% end %>
# @see https://api.slack.com/methods/<%= group %>.<%= name %>
# @see https://github.com/dblock/slack-api-ref/blob/master/methods/<%= group %>/<%= group %>.<%= name %>.json
- def <%= group %>_<%= name %>(options = {})
+ def <%= group.gsub(".", "_") %>_<%= name %>(options = {})
<% data['args'].select{ |k, v| v['required'] }.each do |arg_name, arg_v| %>
throw ArgumentError.new('Required arguments :<%= arg_name %> missing') if options[:<%= arg_name %>].nil?
<% end %>
<% if data['group'] == 'groups' && data['args']['channel'] && !data['args']['channel']['desc'].include?('Can be an encoded ID, or a name.') %>
options = options.merge(channel: groups_id(options)['group']['id']) if options[:channel]