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, Parts::Resource::Prefix, Parts::Resource::PrefixIndex, Parts::Resource::PrefixKeys, Parts::Resource::PrefixValues

Instance Attribute Summary

Attributes inherited from Event

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

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 inherited from BasicTypes::Object

#tap

Methods included from Parts::Resource

#[], #^, _extract_prefix, _instance, _parse, _path_with_prefix, #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.



684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
# File 'lib/when_exe/icalendar.rb', line 684

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

  # parsed 部の属性化
  _parsed(options)

  # 属性の存在チェック
  case (@property['action'].kind_of?(When::Parts::Resource::Element) && @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:



679
680
681
# File 'lib/when_exe/icalendar.rb', line 679

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