pvwatts-ee 0.1.2 → 0.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/pvwatts.rb +4 -5
- data/pvwatts.gemspec +1 -1
- metadata +1 -1
data/lib/pvwatts.rb
CHANGED
@@ -42,10 +42,9 @@ class Pvwatts
|
|
42
42
|
keys = opts.keys
|
43
43
|
client = Savon::Client.new("http://pvwatts.nrel.gov/PVWATTS.asmx?WSDL")
|
44
44
|
@latitude, @longitude = [opts[:latitude], opts[:longitude]]
|
45
|
-
@dc_rating, @tilt, @azimuth, @derate = opts[:dc_rating], opts[:tilt], opts[:azimuth], opts[:derate]
|
46
|
-
|
47
|
-
raise ArgumentError, "passed -> latitude: #{@latitude}, longitude: #{@longitude}, dc_rating: #{@dc_rating}
|
48
|
-
tilt: #{@tilt} azimuth: #{@azimuth} derate: #{@derate}"
|
45
|
+
@dc_rating, @tilt, @azimuth, @derate, @cost, @array_type = opts[:dc_rating], opts[:tilt], opts[:azimuth], opts[:derate], opts[:cost], opts[:array_type]
|
46
|
+
unless @latitude && @longitude && @dc_rating && @tilt && @azimuth && @derate && @cost && @array_type
|
47
|
+
raise ArgumentError, "passed -> latitude: #{@latitude}, longitude: #{@longitude}, dc_rating: #{@dc_rating}, tilt: #{@tilt}, azimuth: #{@azimuth}, derate: #{@derate}, cost: #{@cost}, array_type: #{@array_type}"
|
49
48
|
end
|
50
49
|
req = prep_request(@latitude, @longitude, @dc_rating, @tilt, @azimuth, @derate, @array_type, @cost)
|
51
50
|
|
@@ -67,7 +66,7 @@ class Pvwatts
|
|
67
66
|
|
68
67
|
private
|
69
68
|
|
70
|
-
def prep_request(latitude, longitude, dc_rating, tilt, azimuth, derate, array_type, cost
|
69
|
+
def prep_request(latitude, longitude, dc_rating, tilt, azimuth, derate, array_type, cost)
|
71
70
|
Rails.logger.debug "calling pvwatts with: latitude: #{latitude}, longitude: #{longitude}, dc_rating: #{dc_rating}, tilt: #{tilt}, azimuth: #{azimuth}, dc_derate: #{derate}, cost: #{cost}, array_type: #{array_type}" if Object.const_defined?(:Rails)
|
72
71
|
{ 'wsdl:key' => api_key,
|
73
72
|
'wsdl:latitude' => latitude,
|
data/pvwatts.gemspec
CHANGED