Class: Zm::Client::Message::FlagsCollection

Inherits:
Object
  • Object
show all
Defined in:
lib/zm/client/message/message_flags.rb

Instance Method Summary collapse

Constructor Details

#initialize(parent) ⇒ FlagsCollection

Returns a new instance of FlagsCollection.



8
9
10
# File 'lib/zm/client/message/message_flags.rb', line 8

def initialize(parent)
  @parent = parent
end

Instance Method Details

#allObject



12
13
14
# File 'lib/zm/client/message/message_flags.rb', line 12

def all
  @all || all!
end

#all!Object



16
17
18
# File 'lib/zm/client/message/message_flags.rb', line 16

def all!
  @parent.f.to_s.chars
end

#attachment?Boolean

Returns:

  • (Boolean)


30
31
32
# File 'lib/zm/client/message/message_flags.rb', line 30

def attachment?
  all.include?('a')
end

#calendar_invite?Boolean

Returns:

  • (Boolean)


46
47
48
# File 'lib/zm/client/message/message_flags.rb', line 46

def calendar_invite?
  all.include?('v')
end

#draft?Boolean

Returns:

  • (Boolean)


50
51
52
# File 'lib/zm/client/message/message_flags.rb', line 50

def draft?
  all.include?('d')
end

#flag!Object



91
92
93
94
# File 'lib/zm/client/message/message_flags.rb', line 91

def flag!
  attrs = { op: 'flag', id: @parent.id }
  @parent.sacc.invoke(build(attrs))
end

#flagged?Boolean

Returns:

  • (Boolean)


26
27
28
# File 'lib/zm/client/message/message_flags.rb', line 26

def flagged?
  all.include?('f')
end

#forwarded?Boolean

Returns:

  • (Boolean)


42
43
44
# File 'lib/zm/client/message/message_flags.rb', line 42

def forwarded?
  all.include?('w')
end

#imap_deleted?Boolean

Returns:

  • (Boolean)


54
55
56
# File 'lib/zm/client/message/message_flags.rb', line 54

def imap_deleted?
  all.include?('x')
end

#low_priority?Boolean

Returns:

  • (Boolean)


66
67
68
# File 'lib/zm/client/message/message_flags.rb', line 66

def low_priority?
  all.include?('?')
end

#notification?Boolean

Returns:

  • (Boolean)


58
59
60
# File 'lib/zm/client/message/message_flags.rb', line 58

def notification?
  all.include?('n')
end

#priority?Boolean

Returns:

  • (Boolean)


70
71
72
# File 'lib/zm/client/message/message_flags.rb', line 70

def priority?
  all.include?('+')
end

#read!Object



81
82
83
84
# File 'lib/zm/client/message/message_flags.rb', line 81

def read!
  attrs = { op: 'read', id: @parent.id }
  @parent.sacc.invoke(build(attrs))
end

#repliedObject



34
35
36
# File 'lib/zm/client/message/message_flags.rb', line 34

def replied
  all.include?('r')
end

#sent_by_me?Boolean

Returns:

  • (Boolean)


38
39
40
# File 'lib/zm/client/message/message_flags.rb', line 38

def sent_by_me?
  all.include?('s')
end

#unflag!Object



86
87
88
89
# File 'lib/zm/client/message/message_flags.rb', line 86

def unflag!
  attrs = { op: '!flag', id: @parent.id }
  @parent.sacc.invoke(build(attrs))
end

#unread!Object

actions



76
77
78
79
# File 'lib/zm/client/message/message_flags.rb', line 76

def unread!
  attrs = { op: '!read', id: @parent.id }
  @parent.sacc.invoke(build(attrs))
end

#unread?Boolean

properties

Returns:

  • (Boolean)


22
23
24
# File 'lib/zm/client/message/message_flags.rb', line 22

def unread?
  all.include?('u')
end

#urgent?Boolean

Returns:

  • (Boolean)


62
63
64
# File 'lib/zm/client/message/message_flags.rb', line 62

def urgent?
  all.include?('!')
end