lib/green-button-data/configuration.rb in green-button-data-0.3.2 vs lib/green-button-data/configuration.rb in green-button-data-0.4.0.alpha.pre.1

- old
+ new

@@ -11,22 +11,26 @@ :reading_type_path, :subscription_path, :usage_point_path, :usage_summary_path - def application_information_url - return URI.join(@base_url, @application_information_path).to_s + def application_information_url(id = nil) + uri = URI.join @base_url, @application_information_path + uri = URI.join uri, "#{id}/" if id + return uri.to_s end def application_information_url=(url) uri = URI.parse url @base_url = "#{uri.scheme}://#{uri.host}" @application_information_path = uri.path end - def authorization_url - return URI.join(@base_url, @authorization_path).to_s + def authorization_url(id = nil) + uri = URI.join @base_url, @authorization_path + uri = URI.join uri, "#{id}/" if id + return uri.to_s end def authorization_url=(url) uri = URI.parse url @base_url = "#{uri.scheme}://#{uri.host}" @@ -54,11 +58,13 @@ uri = URI.join uri, "#{interval_block_id}/" if interval_block_id return uri.to_s end - def local_time_parameters_url - return URI.join @base_url, @local_time_parameters_path + def local_time_parameters_url(id = nil) + uri = URI.join @base_url, @local_time_parameters_path + uri = URI.join uri, "#{id}/" if id + return uri.to_s end def meter_reading_url(kwargs = {}) subscription_id = kwargs[:subscription_id] usage_point_id = kwargs[:usage_point_id]