Class: REM::R
- Inherits:
-
Object
- Object
- REM::R
- Defined in:
- lib/remind/remind.rb
Overview
The Reminder object.
Instance Attribute Summary collapse
-
#attr ⇒ Object
high level event hash.
Instance Method Summary collapse
-
#id ⇒ Object
Reminder event id.
-
#initialize(k) ⇒ R
constructor
Reminder
k. -
#to_rem ⇒ Object
Reminder event hash to reminder string.
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
#attr ⇒ Object
high level event hash
58 59 60 |
# File 'lib/remind/remind.rb', line 58 def attr @attr end |
Instance Method Details
#id ⇒ Object
Reminder event id.
65 |
# File 'lib/remind/remind.rb', line 65 def id; @id; end |
#to_rem ⇒ Object
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 |