Class: Vobject::Vcalendar::PropertyValue::Periodlist

Inherits:
PropertyValue
  • Object
show all
Defined in:
lib/vobject/vcalendar/propertyvalue.rb

Instance Attribute Summary

Attributes inherited from PropertyValue

#errors, #norm, #type, #value

Instance Method Summary collapse

Methods inherited from PropertyValue

#<=>, #name, #to_norm

Constructor Details

#initialize(val) ⇒ Periodlist

Returns a new instance of Periodlist.



459
460
461
462
# File 'lib/vobject/vcalendar/propertyvalue.rb', line 459

def initialize(val)
  self.value = val
  self.type = "periodlist"
end

Instance Method Details

#to_hashObject



473
474
475
# File 'lib/vobject/vcalendar/propertyvalue.rb', line 473

def to_hash
  value.map { |m| m.each { |k, v| m[k] = v.to_hash } }
end

#to_sObject



464
465
466
467
468
469
470
471
# File 'lib/vobject/vcalendar/propertyvalue.rb', line 464

def to_s
  value.map do |m|
    ret = m[:start].to_s + "/"
    ret += m[:end].to_s if m.has_key? :end
    ret += m[:duration].to_s if m.has_key? :duration
    ret
  end.join(",")
end