joeyates / ruby-sun-times

Calculate sunrise and sunset times for a given time and place
MIT License
44 stars 12 forks source link

NoMethodError #6

Closed wasafiri closed 10 years ago

wasafiri commented 10 years ago

when trying to execute this code

latitude = 40.740614 longitude = -73.924723 puts SunTimes.set(Date.today, latitude, longitude).localtime

I get this error:

sun_times.rb:42:in set': private methodcalculate' called for #SunTimes:0x007fc374c3b470 (NoMethodError)

I tried running the example code provided in the documentation, pasted below, and got the same error.

day = Date.new(2010, 3, 8) latitude = 43.779 longitude = 11.432 puts SunTimes.set(day, latitude, longitude)

joeyates commented 10 years ago

Hello, thanks for opening the issue.

There were two problems: 1) The class methods were calling the wrong methods internally, 2) The class methods themselves are deprecated - I've updated the README accordingly.