Class: IERS::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/iers/configuration.rb

Constant Summary collapse

DEFAULT_CACHE_DIR =
Pathname("~/.cache/iers").expand_path
DEFAULT_SOURCES =
{
  finals: "https://datacenter.iers.org/data/latestVersion/finals.all.iau2000.txt",
  leap_seconds: "https://hpiers.obspm.fr/iers/bul/bulc/Leap_Second.dat"
}.freeze
DEFAULT_DOWNLOAD_TIMEOUT =
30
DEFAULT_INTERPOLATION =
:lagrange
DEFAULT_LAGRANGE_ORDER =
4
INTERPOLATION_METHODS =
%i[lagrange linear].freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Returns a new instance of Configuration.



30
31
32
33
34
35
36
37
38
# File 'lib/iers/configuration.rb', line 30

def initialize
  @cache_dir = DEFAULT_CACHE_DIR
  @sources = DEFAULT_SOURCES.dup
  @download_timeout = DEFAULT_DOWNLOAD_TIMEOUT
  @finals_path = nil
  @leap_second_path = nil
  @interpolation = DEFAULT_INTERPOLATION
  @lagrange_order = DEFAULT_LAGRANGE_ORDER
end

Instance Attribute Details

#cache_dirPathname

Returns:

  • (Pathname)


16
17
18
# File 'lib/iers/configuration.rb', line 16

def cache_dir
  @cache_dir
end

#download_timeoutInteger

Returns:

  • (Integer)


20
21
22
# File 'lib/iers/configuration.rb', line 20

def download_timeout
  @download_timeout
end

#finals_pathPathname?

Returns:

  • (Pathname, nil)


22
23
24
# File 'lib/iers/configuration.rb', line 22

def finals_path
  @finals_path
end

#interpolationSymbol

Returns +:lagrange+ or +:linear+.

Returns:

  • (Symbol)

    +:lagrange+ or +:linear+



26
27
28
# File 'lib/iers/configuration.rb', line 26

def interpolation
  @interpolation
end

#lagrange_orderInteger

Returns:

  • (Integer)


28
29
30
# File 'lib/iers/configuration.rb', line 28

def lagrange_order
  @lagrange_order
end

#leap_second_pathPathname?

Returns:

  • (Pathname, nil)


24
25
26
# File 'lib/iers/configuration.rb', line 24

def leap_second_path
  @leap_second_path
end

#sourcesHash{Symbol => String}

Returns:

  • (Hash{Symbol => String})


18
19
20
# File 'lib/iers/configuration.rb', line 18

def sources
  @sources
end