Class: When::TimeStandard::TimeStandard

Inherits:
BasicTypes::Object show all
Includes:
When::TimeStandard
Defined in:
lib/when_exe/timestandard.rb,
lib/when_exe/timestandard-canopus.rb

Overview

時刻系のひながた

Constant Summary collapse

Ratio =
1.0

Constants included from When::TimeStandard

DeltaT, DeltaT0, TAI_UTC

Constants included from Namespace

Namespace::DC, Namespace::DCQ, Namespace::DCT, Namespace::FOAF, Namespace::OWL, Namespace::RDF, Namespace::RDFC, Namespace::RDFS, Namespace::RSS, Namespace::XSD

Instance Attribute Summary

Attributes inherited from BasicTypes::Object

#label

Attributes included from Parts::Resource

#child, #keys, #locale, #namespace

Instance Method Summary collapse

Methods included from When::TimeStandard

_setup_, _setup_info, delta_t, delta_t_coordinated, delta_t_observed, delta_t_observed_nasa, delta_t_observed_poly, from_dynamical_time, from_time_object, to_dynamical_time, to_time_object

Methods included from Parts::Resource

#[], #^, _instance, _setup_, _setup_info, base_uri, #each, #enum_for, #hierarchy, #include?, #included?, #iri, #leaf?, #m17n, #map, #parent, #registered?, root_dir

Methods included from Parts::Resource::Pool

#[], #[]=, #_setup_

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class When::Parts::Resource

Instance Method Details

#from_dynamical_date(date) ⇒ Numeric

dynamical date を当該時刻系の日付に変換する

Parameters:

  • date (Numeric)

    dynamical date

Returns:

  • (Numeric)

    当該時刻系の日付



468
469
470
471
472
# File 'lib/when_exe/timestandard.rb', line 468

def from_dynamical_date(date)
  When::TM::JulianDate._t_to_d(
    from_dynamical_time(
      When::TM::JulianDate._d_to_t(+date)))
end

#from_dynamical_time(time) ⇒ Numeric

dynamical time を universal time に変換する

Parameters:

  • time (Numeric)

    dynamical time

Returns:



446
447
448
# File 'lib/when_exe/timestandard.rb', line 446

def from_dynamical_time(time)
  When::TimeStandard.from_dynamical_time(time)
end

#from_time_object(time) ⇒ Numeric

Time オブジェクトを universal time に変換する

Parameters:

Returns:



480
481
482
# File 'lib/when_exe/timestandard.rb', line 480

def from_time_object(time)
  from_dynamical_time(When::TimeStandard.from_time_object(time))
end

#has_leap?Boolean

当該時刻系に閏秒があるか?

Returns:

  • (Boolean)
    • false 閏秒なし



498
499
500
# File 'lib/when_exe/timestandard.rb', line 498

def has_leap?
  false
end

#rate_of_clockNumeric

時間の歩度

Returns:



506
507
508
# File 'lib/when_exe/timestandard.rb', line 506

def rate_of_clock
  self.class::Ratio
end

#to_dynamical_date(date) ⇒ Numeric

当該時刻系の日付を dynamical date に変換する

Parameters:

  • date (Numeric)

    当該時刻系の日付

Returns:



456
457
458
459
460
# File 'lib/when_exe/timestandard.rb', line 456

def to_dynamical_date(date)
  When::TM::JulianDate._t_to_d(
    to_dynamical_time(
      When::TM::JulianDate._d_to_t(+date)))
end

#to_dynamical_time(time) ⇒ Numeric

universal time を dynamical time に変換する

Parameters:

  • time (Numeric)

    universal time

Returns:



436
437
438
# File 'lib/when_exe/timestandard.rb', line 436

def to_dynamical_time(time)
  When::TimeStandard.to_dynamical_time(time)
end

#to_time_object(time) ⇒ ::Time

universal time を Time オブジェクトに変換する

Parameters:

  • time (Numeric)

    universal time

Returns:



490
491
492
# File 'lib/when_exe/timestandard.rb', line 490

def to_time_object(time)
  When::TimeStandard.to_time_object(to_dynamical_time(time))
end