Module: DarkSky

Defined in:
lib/darksky-api.rb,
lib/darksky-api/day.rb,
lib/darksky-api/config.rb,
lib/darksky-api/current.rb,
lib/darksky-api/version.rb,
lib/darksky-api/location.rb,
lib/darksky-api/common-methods.rb

Overview

Author:

Version:

  • 0.1.6

Defined Under Namespace

Classes: CommonMethods, Location

Constant Summary collapse

VERSION =

version of this library (follows SemVer for versions >= 1.0.0)

'0.1.6'.freeze

Class Method Summary collapse

Class Method Details

.config(opts) ⇒ void

This method returns an undefined value.

set required and optional class variables

keyword arguments:

  • key [required] ─ API key from DarkSky

Since:

  • 0.1.0



9
10
11
12
13
14
15
16
# File 'lib/darksky-api/config.rb', line 9

def self.config(opts)
  defaults = {
  }
  opts = defaults.merge opts

  # required parameters
  @@key = opts.fetch(:key)
end

.keyString

Returns API key that was set by .config().

Examples:

DarkSky.key #=> '0f1e2d3c4b5a6978'

Returns:

  • (String)

    API key that was set by .config()

Since:

  • 0.1.0



22
23
24
# File 'lib/darksky-api/config.rb', line 22

def self.key
  @@key
end