lib/green-button-data/configuration.rb in green-button-data-0.6.0 vs lib/green-button-data/configuration.rb in green-button-data-0.7.0

- old
+ new

@@ -10,11 +10,12 @@ :meter_reading_path, :reading_type_path, :subscription_path, :usage_point_path, :usage_summary_path, - :retail_customer_path + :retail_customer_path, + :bulk_path def application_information_url(id = nil) return build_url @application_information_path, id end @@ -132,9 +133,21 @@ if retail_customer_id retail_customer_url = build_url(@retail_customer_path) return "#{retail_customer_url}/#{retail_customer_id}" else raise ArgumentError.new "Missing required arguments: subscription_id" + end + end + + def bulk_url(kwargs = {}) + subscription_id = kwargs[:subscription_id] + bulk_file_id = kwargs[:bulk_file_id] + + if subscription_id && bulk_file_id + bulk_url = build_url(@bulk_path) + return "#{bulk_url}/#{subscription_id}/#{bulk_file_id}" + else + raise ArgumentError.new "Missing required arguments: subscription_id or bulk_file_id" end end private