Skip to content


Subversion checkout URL

You can clone with
Download ZIP


NoMethodError #6

wasafiri opened this Issue · 1 comment

2 participants


when trying to execute this code

latitude = 40.740614
longitude = -73.924723
puts SunTimes.set(, 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 =, 3, 8)
latitude = 43.779
longitude = 11.432
puts SunTimes.set(day, latitude, longitude)

@joeyates joeyates closed this issue from a commit
@joeyates Prefer instance methods to class methods.
* Update README to give an example using an instance method,
* Add spec for deprecated class method,
* Call the public set and rise methods from the class methods (closes
@joeyates joeyates closed this in e25d596

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.