Class: Mo2tex::Event
- Inherits:
-
Object
- Object
- Mo2tex::Event
- Defined in:
- lib/mo2tex/event.rb
Instance Attribute Summary collapse
-
#desc ⇒ Object
readonly
Returns the value of attribute desc.
-
#dtend ⇒ Object
readonly
Returns the value of attribute dtend.
-
#dtstart ⇒ Object
readonly
Returns the value of attribute dtstart.
-
#lnumber ⇒ Object
readonly
Returns the value of attribute lnumber.
-
#loc ⇒ Object
readonly
Returns the value of attribute loc.
-
#ltot ⇒ Object
readonly
Returns the value of attribute ltot.
-
#online ⇒ Object
readonly
Returns the value of attribute online.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #color ⇒ Object
-
#initialize(ls, le, ln, lt, t, desc, loc, online) ⇒ Event
constructor
A new instance of Event.
- #to_ical(ical) ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(ls, le, ln, lt, t, desc, loc, online) ⇒ Event
Returns a new instance of Event.
11 12 13 14 15 16 17 18 19 20 |
# File 'lib/mo2tex/event.rb', line 11 def initialize(ls, le, ln, lt, t, desc, loc, online) @dtstart = DateTime.parse(ls.to_s) @dtend = DateTime.parse(le.to_s) @lnumber = ln @ltot = lt @title = t @desc = desc @loc = loc @online = online end |
Instance Attribute Details
#desc ⇒ Object (readonly)
Returns the value of attribute desc.
9 10 11 |
# File 'lib/mo2tex/event.rb', line 9 def desc @desc end |
#dtend ⇒ Object (readonly)
Returns the value of attribute dtend.
9 10 11 |
# File 'lib/mo2tex/event.rb', line 9 def dtend @dtend end |
#dtstart ⇒ Object (readonly)
Returns the value of attribute dtstart.
9 10 11 |
# File 'lib/mo2tex/event.rb', line 9 def dtstart @dtstart end |
#lnumber ⇒ Object (readonly)
Returns the value of attribute lnumber.
9 10 11 |
# File 'lib/mo2tex/event.rb', line 9 def lnumber @lnumber end |
#loc ⇒ Object (readonly)
Returns the value of attribute loc.
9 10 11 |
# File 'lib/mo2tex/event.rb', line 9 def loc @loc end |
#ltot ⇒ Object (readonly)
Returns the value of attribute ltot.
9 10 11 |
# File 'lib/mo2tex/event.rb', line 9 def ltot @ltot end |
#online ⇒ Object (readonly)
Returns the value of attribute online.
9 10 11 |
# File 'lib/mo2tex/event.rb', line 9 def online @online end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
9 10 11 |
# File 'lib/mo2tex/event.rb', line 9 def title @title end |
Instance Method Details
#color ⇒ Object
56 57 58 |
# File 'lib/mo2tex/event.rb', line 56 def color return "\"green\"" end |
#to_ical(ical) ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/mo2tex/event.rb', line 26 def to_ical(ical) ical.event do |e| e.dtstart = self.dtstart e.dtend = self.dtend e.summary = self.title e.description = self.desc e.location = self.loc e.ip_class = 'PUBLIC' if is_online? e.location = 'Microsoft Teams Meeting' e.description += <<EOR \n_____________________________________________________________ ___________________\nMicrosoft Teams Need help?<https://aka.ms/JoinTeamsMe eting?omkt=en-US>\nJoin the meeting now<https://teams.microsoft.com/l/meet up-join/19%3ameeting_MWZlZDdkZmMtNjRkNi00M2U3LTgwMzUtMjkwNGQ1YTY3N2I4%40th read.v2/0?context=%7b%22Tid%22%3a%2276c57fd2-8d47-4cb5-a7a2-83c2cd0c3565%2 2%2c%22Oid%22%3a%22a29bd7f0-b99d-4031-8cf5-fabe578a7d05%22%7d>\nMeeting ID : 358 935 834 932\nPasscode: 9wNLge\n________________________________\nFor organizers: Meeting options<https://teams.microsoft.com/meetingOptions/?o rganizerId=a29bd7f0-b99d-4031-8cf5-fabe578a7d05&tenantId=76c57fd2-8d47-4cb 5-a7a2-83c2cd0c3565&threadId=19_meeting_MWZlZDdkZmMtNjRkNi00M2U3LTgwMzUtMj [email protected]&messageId=0&language=en-US>\n____________________ ____________________________________________________________\n EOR end end return ical end |
#to_s ⇒ Object
22 23 24 |
# File 'lib/mo2tex/event.rb', line 22 def to_s return self.title + ' ' + self.dtstart.strftime("%d/%m/%Y %H:%M") + '-' + self.dtend.strftime("%H:%M") + ' ' + self.lnumber.to_s + '/' + self.ltot.to_s end |