Class: When::Coordinates::DayBorder

Inherits:
Border show all
Defined in:
lib/when_exe/coordinates.rb

Overview

日時要素の境界 - 日の出,日の入り

Direct Known Subclasses

Sunrise, Sunset

Constant Summary

Constants included from Parts::Resource

Parts::Resource::ConstList, Parts::Resource::ConstTypes, Parts::Resource::IRIDecode, Parts::Resource::IRIDecodeTable, Parts::Resource::IRIEncode, Parts::Resource::IRIEncodeTable, Parts::Resource::IRIHeader, Parts::Resource::LabelProperty

Instance Attribute Summary

Attributes inherited from BasicTypes::Object

#label

Attributes included from Parts::Resource

#_pool, #child, #keys, #locale, #namespace

Instance Method Summary collapse

Methods inherited from Border

#_adjust_epoch, #behavior

Methods included from Parts::Resource

#[], #^, _abbreviation_to_iri, _decode, _encode, _extract_prefix, _instance, _instantiate, _parse, _path_with_prefix, _replace_tags, _setup_, _setup_info, _simplify_path, base_uri, #each, #enum_for, #hierarchy, #include?, #included?, #iri, #leaf?, #m17n, #map, #next, #parent, #prev, #registered?, root_dir

Methods included from Parts::Resource::Pool

#[], #[]=, #_pool, #_setup_, #pool_keys

Methods included from Parts::Resource::Synchronize

#synchronize

Dynamic Method Handling

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

Instance Method Details

#_date_adjust(source) ⇒ Object

日付の補正



2403
2404
2405
# File 'lib/when_exe/coordinates.rb', line 2403

def _date_adjust(source)
  source * 1 + @border[0] * 0
end

#border(date = [], clock = When::UTC) ⇒ Array<Numeric>

Note:

属性 @event によって境界を計算する (see Ephemeris::Formula#day_event)

境界の取得

Parameters:

Returns:



2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
# File 'lib/when_exe/coordinates.rb', line 2385

def border(date=[], clock=When::UTC)
  return @border unless date[0] && clock.formula

  time =
    clock._number_to_coordinates(clock.second *
      clock.time_standard.from_dynamical_time(
        When::TM::JulianDate._d_to_t(
          clock.formula.first.day_event(
            clock.time_standard.to_dynamical_date(date[0] + @border[0]*0), @event, When.Resource('_ep:Sun'), @height
          ))))

  time[0] += When::TM::JulianDate::JD19700101
  time[0]  = When::Coordinates::Pair.new(time[0]-@border[0]*0, @border[0]*0) unless @border[0]*0 == 0
  clock._encode(time, false)
end