Class: When::Coordinates::Index

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

Overview

暦座標

暦座標の特性を定義する

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

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 collapse

Attributes inherited from BasicTypes::Object

#label

Attributes included from Parts::Resource

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

Class Method Summary collapse

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, #parent, #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 Attribute Details

#baseInteger (readonly)

日時要素の下限

Returns:

  • (Integer)

    年月日は 1, 時分秒は 0



673
674
675
# File 'lib/when_exe/coordinates.rb', line 673

def base
  @base
end

#branchHash (readonly)

日時要素名(枝)

Returns:

  • (Hash)

    { Numeric=>When::BasicTypes::M17n }

    When::Coordinates::Pair の branch の値からprefix

    (「閏」などの文字列)を引くための Hash



701
702
703
# File 'lib/when_exe/coordinates.rb', line 701

def branch
  @branch
end

#indexHash (readonly)

インデクス(幹枝)

Returns:

  • (Hash)

    { String=>When::Coordinates::Pair }

    日時要素名から When::Coordinates::Pair を引くための Hash

    初期化時に @trunk, @branch から自動的に生成する



721
722
723
# File 'lib/when_exe/coordinates.rb', line 721

def index
  @index
end

#shiftInteger (readonly)

座標値のシフト

Returns:

  • (Integer)

    (デフォルト 0)

    月 - 名称を trunk 配列の何番目(0オリジン)からとるかを指定

    日 - 剰余類のシフトを指定



691
692
693
# File 'lib/when_exe/coordinates.rb', line 691

def shift
  @shift
end

#trunkWhen::BasicTypes::M17n (readonly)

日時要素名(幹)

Returns:



681
682
683
# File 'lib/when_exe/coordinates.rb', line 681

def trunk
  @trunk
end

#trunk_branchHash (readonly)

日時要素名(幹枝)

Returns:

  • (Hash)

    { When::Coordinates::Pair=>When::BasicTypes::M17n }

    When::Coordinates::Pair から 日時要素名を引くための Hash

    初期化時に @trunk, @branch から自動的に生成する



711
712
713
# File 'lib/when_exe/coordinates.rb', line 711

def trunk_branch
  @trunk_branch
end

#unitInteger (readonly)

日時要素の要素数

Returns:

  • (Integer)

    「時」なら 24, 「分」なら 60

    日数や太陰太陽暦の月数のように不定の場合は nil



665
666
667
# File 'lib/when_exe/coordinates.rb', line 665

def unit
  @unit
end

Class Method Details

.precision(specification) ⇒ Object



724
725
726
727
# File 'lib/when_exe/coordinates.rb', line 724

def self.precision(specification)
  return specification.to_i if (specification.kind_of?(Numeric))
  return (PRECISION[specification] || VALUE[specification] || When::SYSTEM)
end