Method: When::V::Alarm#initialize

Defined in:
lib/when_exe/icalendar.rb

#initialize(options) ⇒ Alarm

Returns a new instance of Alarm.



848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
# File 'lib/when_exe/icalendar.rb', line 848

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