Class: USNO::Imagery::Earth::View
- Inherits:
-
PayDirt::Base
- Object
- PayDirt::Base
- USNO::Imagery::Earth::View
- Defined in:
- lib/usno/imagery/earth/view.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.
7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/usno/imagery/earth/view.rb', line 7 def initialize( = {}) = { time: Time.now, root_url: "http://api.usno.navy.mil/", resource: self.class.name.downcase.split("::")[1..-2].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, :view, ) and validate_state end |
Instance Method Details
#call ⇒ Object
19 20 21 |
# File 'lib/usno/imagery/earth/view.rb', line 19 def call result(true, query_for(@root_url + @resource)) end |