Class: When::V::Alarm

Inherits:
Event show all
Defined in:
lib/when_exe/icalendar.rb

Overview

Alarm を定義する

BEGIN:VALARM...END:VALARM のブロックに対応

Constant Summary

Constants inherited from Event

Event::Classes, Event::Properties

Constants inherited from Root

Root::AwareProperties, Root::Classes, Root::DefaultOptional, Root::DefaultUnique, Root::Properties

Constants included from Parts::Resource

Parts::Resource::LabelProperty

Instance Attribute Summary

Attributes inherited from Event

#dtend, #dtstart, #duration, #exdate, #first_occurrence, #rdate, #rrule, #summary

Attributes inherited from Root

#calscale, #property

Attributes included from Parts::Resource

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

Instance Method Summary collapse

Methods inherited from Event

#_enumerator_list, _setup_, #dtstop, #each, #to_gcalevent

Methods included from Parts::Resource::Pool

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

Methods included from Parts::Resource::Synchronize

#synchronize

Methods inherited from Root

#_enumerator, #include?

Methods included from Parts::Resource

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

Constructor Details

#initialize(options) ⇒ Alarm

Returns a new instance of Alarm


734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
# File 'lib/when_exe/icalendar.rb', line 734

def initialize(options)
  # 包含関係
  @_pool = {}
  @_pool['..'] = options['..']

  # parsed 部の属性化
  _parsed(options)

  # 属性の存在チェック
  case (@property['action'].kind_of?(When::Parts::Resource::ContentLine) && @property['action'].object)
  when 'AUDIO'
    aware = _attribute_appearance([
      ['action', 'trigger'], [],
      ['duration', 'repeat', 'attach'], [], []])
  when 'DISPLAY'
    aware = _attribute_appearance([
      ['action', 'description', 'trigger'], [],
      ['duration', 'repeat'], [], []])
  when 'EMAIL'
    aware = _attribute_appearance([
      ['action', 'description', 'trigger', 'summary'], ['attendee'],
      ['duration', 'repeat'], [], ['attach']])
  else
    raise ArgumentError, "The ACTION is invalid"
  end

  # 属性の設定
  _initialize_attributes(aware)

  # 包含オブジェクトがないことの確認
  _child(options, [])
end

Dynamic Method Handling

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

Instance Method Details

#labelString

ユニーク識別名 - ACTION Property をユニーク識別名とする。

Returns:


729
730
731
# File 'lib/when_exe/icalendar.rb', line 729

def label
  @label ||= @property['action'].object # TODO
end