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.
Files changed (3) hide show
  1. data/lib/pvwatts.rb +4 -5
  2. data/pvwatts.gemspec +1 -1
  3. 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
- if @latitude.nil? || @longitude.nil? || @dc_rating.nil? || @tilt.nil? || @azimuth.nil? || @derate.nil?
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=0.0)
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
@@ -5,7 +5,7 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{pvwatts-ee}
8
- s.version = "0.1.2"
8
+ s.version = "0.1.3"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Matt Aimonetti", "Brenda Strech"]
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: pvwatts-ee
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.1.2
5
+ version: 0.1.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - Matt Aimonetti