Class: REM::R

Inherits:
Object
  • Object
show all
Defined in:
lib/remind/remind.rb

Overview

The Reminder object.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(k) ⇒ R

Reminder k



60
61
62
63
# File 'lib/remind/remind.rb', line 60

def initialize k
  @id = k
  @attr = {}
end

Instance Attribute Details

#attrObject

high level event hash



58
59
60
# File 'lib/remind/remind.rb', line 58

def attr
  @attr
end

Instance Method Details

#idObject

Reminder event id.



65
# File 'lib/remind/remind.rb', line 65

def id; @id; end

#to_remObject

Reminder event hash to reminder string.



67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
# File 'lib/remind/remind.rb', line 67

def to_rem
#      puts %[R[#{@id}] #{@attr}]
  a, i = [], [ @id ]
  if @attr.has_key? :date
    a << %[#{@attr[:date]}]
    if @attr.has_key? :lead
      a << %[++#{@attr[:lead]}]
    end
  end
  if @attr.has_key? :hour
    if @attr.has_key? :minute
      a << %[AT #{@attr[:hour]}:#{@attr[:minute]}]
      i << %[#{@attr[:hour]}:#{@attr[:minute]}]
    else
      a << %[AT #{@attr[:hour]}:00]
      i << %[#{@attr[:hour]}:00]
    end
  end
  return %[REM #{a.join(" ")} MSG #{i.join(" ")}\n]
end