Class: USNO::Imagery::View
- Inherits:
-
PayDirt::Base
- Object
- PayDirt::Base
- USNO::Imagery::View
- Defined in:
- lib/usno/imagery.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(options = {}) ⇒ View
constructor
A new instance of View.
Constructor Details
#initialize(options = {}) ⇒ View
Returns a new instance of View.
19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/usno/imagery.rb', line 19 def initialize( = {}) = { time: Time.now, root_url: "http://api.usno.navy.mil/", resource: self.class.name.downcase.split("::")[1..-1].join("/") + ".png" }.merge() # sets instance variables from key value pairs, # will fail if any keys given before options aren't in options (:time, :root_url, :resource, ) end |
Instance Method Details
#call ⇒ Object
31 32 33 |
# File 'lib/usno/imagery.rb', line 31 def call result(true, query_for(@root_url + @resource)) end |