Class: Larch::Database::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/larch/db/message.rb

Instance Method Summary collapse

Instance Method Details

#flagsObject



4
5
6
7
8
9
# File 'lib/larch/db/message.rb', line 4

def flags
  self[:flags].split(',').sort.map do |f|
    # Flags beginning with $ should be strings; all others should be symbols.
    f[0,1] == '$' ? f : f.to_sym
  end
end

#flags=(flags) ⇒ Object



15
16
17
# File 'lib/larch/db/message.rb', line 15

def flags=(flags)
  self[:flags] = flags.map{|f| f.to_s }.join(',')
end

#flags_strObject



11
12
13
# File 'lib/larch/db/message.rb', line 11

def flags_str
  self[:flags]
end