Class: Pikuri::Thunderbird::IcalLine::Attendee

Inherits:
Data
  • Object
show all
Defined in:
lib/pikuri/thunderbird/ical_line.rb

Overview

One attendee or organizer, parsed from an +ATTENDEE+/+ORGANIZER+ line. email falls back from the EMAIL param to the mailto: value, name from CN to the email — so both are always present.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#cutypeString? (readonly)

Returns raw CUTYPE (+"INDIVIDUAL"+, +"RESOURCE"+…).

Returns:

  • (String, nil)

    raw CUTYPE (+"INDIVIDUAL"+, +"RESOURCE"+…).



45
46
47
48
49
50
51
52
53
54
# File 'lib/pikuri/thunderbird/ical_line.rb', line 45

Attendee = Data.define(:name, :email, :status, :role, :cutype, :organizer) do
  # @return [Boolean] the ORGANIZER (vs a plain attendee).
  def organizer? = organizer

  # @return [Boolean] an optional invitee (+ROLE=OPT-PARTICIPANT+).
  def optional? = role == 'OPT-PARTICIPANT'

  # @return [Boolean] a room/equipment, not a person (+CUTYPE=RESOURCE+).
  def resource? = cutype == 'RESOURCE'
end

#emailString (readonly)

Returns the address, sans mailto:.

Returns:

  • (String)

    the address, sans mailto:.



45
46
47
48
49
50
51
52
53
54
# File 'lib/pikuri/thunderbird/ical_line.rb', line 45

Attendee = Data.define(:name, :email, :status, :role, :cutype, :organizer) do
  # @return [Boolean] the ORGANIZER (vs a plain attendee).
  def organizer? = organizer

  # @return [Boolean] an optional invitee (+ROLE=OPT-PARTICIPANT+).
  def optional? = role == 'OPT-PARTICIPANT'

  # @return [Boolean] a room/equipment, not a person (+CUTYPE=RESOURCE+).
  def resource? = cutype == 'RESOURCE'
end

#nameString (readonly)

Returns display name (+CN+), or the email when there's no CN.

Returns:

  • (String)

    display name (+CN+), or the email when there's no CN.



45
46
47
48
49
50
51
52
53
54
# File 'lib/pikuri/thunderbird/ical_line.rb', line 45

Attendee = Data.define(:name, :email, :status, :role, :cutype, :organizer) do
  # @return [Boolean] the ORGANIZER (vs a plain attendee).
  def organizer? = organizer

  # @return [Boolean] an optional invitee (+ROLE=OPT-PARTICIPANT+).
  def optional? = role == 'OPT-PARTICIPANT'

  # @return [Boolean] a room/equipment, not a person (+CUTYPE=RESOURCE+).
  def resource? = cutype == 'RESOURCE'
end

#organizerBoolean (readonly)

Returns whether the line was an ORGANIZER, not an ATTENDEE.

Returns:

  • (Boolean)

    whether the line was an ORGANIZER, not an ATTENDEE.



45
46
47
48
49
50
51
52
53
54
# File 'lib/pikuri/thunderbird/ical_line.rb', line 45

Attendee = Data.define(:name, :email, :status, :role, :cutype, :organizer) do
  # @return [Boolean] the ORGANIZER (vs a plain attendee).
  def organizer? = organizer

  # @return [Boolean] an optional invitee (+ROLE=OPT-PARTICIPANT+).
  def optional? = role == 'OPT-PARTICIPANT'

  # @return [Boolean] a room/equipment, not a person (+CUTYPE=RESOURCE+).
  def resource? = cutype == 'RESOURCE'
end

#roleString? (readonly)

Returns raw ROLE (+"REQ-PARTICIPANT"+, "OPT-PARTICIPANT").

Returns:

  • (String, nil)

    raw ROLE (+"REQ-PARTICIPANT"+, "OPT-PARTICIPANT").



45
46
47
48
49
50
51
52
53
54
# File 'lib/pikuri/thunderbird/ical_line.rb', line 45

Attendee = Data.define(:name, :email, :status, :role, :cutype, :organizer) do
  # @return [Boolean] the ORGANIZER (vs a plain attendee).
  def organizer? = organizer

  # @return [Boolean] an optional invitee (+ROLE=OPT-PARTICIPANT+).
  def optional? = role == 'OPT-PARTICIPANT'

  # @return [Boolean] a room/equipment, not a person (+CUTYPE=RESOURCE+).
  def resource? = cutype == 'RESOURCE'
end

#statusString? (readonly)

Returns raw PARTSTAT (+"ACCEPTED"+, +"NEEDS-ACTION"+…).

Returns:

  • (String, nil)

    raw PARTSTAT (+"ACCEPTED"+, +"NEEDS-ACTION"+…).



45
46
47
48
49
50
51
52
53
54
# File 'lib/pikuri/thunderbird/ical_line.rb', line 45

Attendee = Data.define(:name, :email, :status, :role, :cutype, :organizer) do
  # @return [Boolean] the ORGANIZER (vs a plain attendee).
  def organizer? = organizer

  # @return [Boolean] an optional invitee (+ROLE=OPT-PARTICIPANT+).
  def optional? = role == 'OPT-PARTICIPANT'

  # @return [Boolean] a room/equipment, not a person (+CUTYPE=RESOURCE+).
  def resource? = cutype == 'RESOURCE'
end

Instance Method Details

#optional?Boolean

Returns an optional invitee (+ROLE=OPT-PARTICIPANT+).

Returns:

  • (Boolean)

    an optional invitee (+ROLE=OPT-PARTICIPANT+).



50
# File 'lib/pikuri/thunderbird/ical_line.rb', line 50

def optional? = role == 'OPT-PARTICIPANT'

#organizer?Boolean

Returns the ORGANIZER (vs a plain attendee).

Returns:

  • (Boolean)

    the ORGANIZER (vs a plain attendee).



47
# File 'lib/pikuri/thunderbird/ical_line.rb', line 47

def organizer? = organizer

#resource?Boolean

Returns a room/equipment, not a person (+CUTYPE=RESOURCE+).

Returns:

  • (Boolean)

    a room/equipment, not a person (+CUTYPE=RESOURCE+).



53
# File 'lib/pikuri/thunderbird/ical_line.rb', line 53

def resource? = cutype == 'RESOURCE'