Class: USNO::Imagery::Earth::View

Inherits:
PayDirt::Base
  • Object
show all
Defined in:
lib/usno/imagery/earth/view.rb

Instance Method Summary collapse

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(options = {})
  options = {
    time:     Time.now,
    root_url: "http://api.usno.navy.mil/",
    resource: self.class.name.downcase.split("::")[1..-2].join("/") + ".png"
  }.merge(options)

  # sets instance variables from key value pairs,
  # will fail if any keys given before options aren't in options
  load_options(:time, :root_url, :resource, :view, options) and validate_state
end

Instance Method Details

#callObject



19
20
21
# File 'lib/usno/imagery/earth/view.rb', line 19

def call
  result(true, query_for(@root_url + @resource))
end