Class: When::V::Root
- Inherits:
-
BasicTypes::Object
- Object
- BasicTypes::Object
- When::V::Root
- Defined in:
- lib/when_exe/icalendar.rb
Overview
iCalendar を構成するクラス群の共通抽象クラス
RFC 5545 のクラスは、有無のチェックを除いてProperty の扱いが共通なので、
Property の扱いを、本クラスにまとめて記述している。
Constant Summary collapse
- Properties =
[[],[],[],[],[]]
- Classes =
nil
- DefaultUnique =
['calscale', 'namespace', 'locale']
- DefaultOptional =
['x_prop', 'iana_prop']
- AwareProperties =
DefaultUnique + ['tzoffsetfrom', 'tzoffsetto', 'tzname', 'dtstart', 'dtend', 'due', 'repeat', 'duration', 'rrule', 'rdate', 'exdate', 'exevent', 'summary', 'freebusy']
Constants included from Parts::Resource
Parts::Resource::ConstList, Parts::Resource::ConstTypes, Parts::Resource::IRIHeader, Parts::Resource::LabelProperty
Instance Attribute Summary collapse
-
#calscale ⇒ When::TM::Calendar
readonly
デフォルトのWhen::TM::Calendar.
-
#property ⇒ Hash
readonly
iCalendar クラス群の属性.
Attributes inherited from BasicTypes::Object
Attributes included from Parts::Resource
#_pool, #child, #keys, #locale, #namespace
Instance Method Summary collapse
-
#_enumerator(*args) ⇒ Object
(also: #to_enum, #enum_for)
イテレータの生成.
-
#include?(date) ⇒ Boolean
指定の日時を含むか?.
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, #hierarchy, #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
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class When::Parts::Resource
Instance Attribute Details
#calscale ⇒ When::TM::Calendar (readonly)
RFC 5545 では、‘GREGORIAN’ のみ指定可能としている。 CALSCALE Property 文字列を capitalize したものに、 prefix _c:(=hosi.org/When/CalendarTypes/)を補い When::TM::Calendar オブジェクトの定義を取得する。
デフォルトのWhen::TM::Calendar
104 105 106 |
# File 'lib/when_exe/icalendar.rb', line 104 def calscale @calscale end |
#property ⇒ Hash (readonly)
iCalendar クラス群の属性
92 93 94 |
# File 'lib/when_exe/icalendar.rb', line 92 def property @property end |
Instance Method Details
#_enumerator(*args) ⇒ Object Also known as: to_enum, enum_for
イテレータの生成
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 |
# File 'lib/when_exe/icalendar.rb', line 123 def _enumerator(*args) = When::Parts::Enumerator.(args) args << exdate = [:exdate] enumerators = _enumerator_list(args) raise ArgumentError, "No enumerator exists" if (enumerators.length==0) # Enumerator の生成 enumerator = if (enumerators.length==1 && exdate.node.size==0) enumerators[0] else [:exdate] = exdate When::Parts::Enumerator::Integrated.new(self, enumerators, *args) end if ::Object.const_defined?(:Date) && (args[0].kind_of?(Range) ? args[0].first : args[0]).kind_of?(::Date) enumerator.instance_eval %Q{ alias :_succ_of_super :succ def succ result = _succ_of_super case result when When::TM::DateAndTime ; result.to_date_time when When::TM::CalDate ; result.to_date else ; result end end } end enumerator end |
#include?(date) ⇒ Boolean
指定の日時を含むか?
114 115 116 117 118 119 |
# File 'lib/when_exe/icalendar.rb', line 114 def include?(date) first = enum_for(date).next return first.include?(date) if first.kind_of?(When::Parts::GeometricComplex) return first == date if first.precision <= date.precision return false end |