Class: USNO::Imagery::Earth::Map

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

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Map

Returns a new instance of Map.



7
8
9
10
11
12
13
14
15
16
17
# File 'lib/usno/imagery/earth/map.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, options)
end

Instance Method Details

#callObject



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

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