lib/twilio-ruby/rest/utils.rb in twilio-ruby-4.9.0.edge vs lib/twilio-ruby/rest/utils.rb in twilio-ruby-4.9.0

- old
+ new

@@ -17,17 +17,10 @@ string.gsub(/[A-Z][a-z]*/) { |s| "_#{s.downcase}" } end protected - # Freeze the base list path. - # Used on list resources so filters (such as /Local) do not affect the - # instance resource path. - def freeze_path - @frozen_path = @path - end - def resource(*resources) custom_resource_names = { sms: 'SMS', sip: 'SIP' } resources.each do |r| resource = twilify r relative_path = custom_resource_names.fetch(r, resource) @@ -36,14 +29,10 @@ Twilio::REST else Twilio::REST.const_get(@submodule) end resource_class = enclosing_module.const_get resource - resource_object = resource_class.new(path, @client) - instance_variable_set("@#{r}", resource_object) - if @frozen_path - resource_object.instance_variable_set(:@frozen_path, @frozen_path) - end + instance_variable_set("@#{r}", resource_class.new(path, @client)) end self.class.instance_eval { attr_reader *resources } end private