時間位置共用体
union of
type When::TM::TemporalPosition
type When::BasicTypes::Date
type When::BasicTypes::Time
type When::BasicTypes::DateTime
see gml schema
オブジェクトの生成
specification : String
String - When Standard Representation として解釈して生成する
When::Parts::GeometricComplex - to_s を 代表文字列とする
options : 暦法や時法などの指定
see When::TM::TemporalPosition._instance
# File when/tmposition.rb, line 80
80: def initialize(specification, options={})
81:
82: if specification.kind_of?(String)
83: @date_time8601 = specification
84: @any_other = TemporalPosition._instance(specification, options)
85: klass = specification.class
86: else
87: @any_other = specification
88: klass = @any_other.class
89: end
90: message = "Irregal specification type: #{klass}"
91:
92: case specification
93: when CalDate ; @date_time8601 = When::BasicTypes::Date.new(specification.to_s)
94: when ClockTime ; @date_time8601 = When::BasicTypes::Time.new(specification.to_s)
95: when TemporalPosition ; @date_time8601 = When::BasicTypes::DateTime.new(specification.to_s)
96: when When::BasicTypes::Date ; raise TypeError, message unless klass == CalDate
97: when When::BasicTypes::Time ; raise TypeError, message unless klass == ClockTime
98: when String ;
99: else ; raise TypeError, message
100: end
101: end
その他のメソッド
When::TM::Position で定義されていないメソッドは 処理を @date_time8601 (type: When::BasicTypes::DateTime) または @any_other (type: When::TM::TemporalPosition) に委譲する (両方ともに有効なメソッドは@any_otherを優先する)
# File when/tmposition.rb, line 111
111: def method_missing(name, *args, &block)
112: union = @any_other.respond_to?(name.to_sym) ? @any_other : @date_time8601
113: union.send(name.to_sym, *args, &block)
114: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.