Class: ConferenceCallService::ConferenceSchedule
- Inherits:
-
Object
- Object
- ConferenceCallService::ConferenceSchedule
- Defined in:
- lib/conference_call_service/conference_schedule.rb
Overview
Indicates when to start a conference call. Be ware that times are are relative to the UTC timezone.
Constant Summary collapse
- @@RECURRING_NONE =
0
- @@RECURRING_HOURLY =
1
- @@RECURRING_DAILY =
2
- @@RECURRING_WEEKLY =
3
- @@RECURRING_MONTHLY =
4
Instance Attribute Summary collapse
-
#day_of_month ⇒ Object
Returns the value of attribute day_of_month.
-
#hour ⇒ Object
Returns the value of attribute hour.
-
#minute ⇒ Object
Returns the value of attribute minute.
-
#month ⇒ Object
Returns the value of attribute month.
-
#notify ⇒ Object
Returns the value of attribute notify.
-
#recurring ⇒ Object
Returns the value of attribute recurring.
-
#year ⇒ Object
Returns the value of attribute year.
Class Method Summary collapse
-
.build_from_xml(xml_doc) ⇒ Object
Static methods.
- .RECURRING_HOURLY ⇒ Object
- .RECURRING_MONTHLY ⇒ Object
- .RECURRING_NONE ⇒ Object
- .RECURRING_WEEKLY ⇒ Object
Instance Method Summary collapse
- #add_to_handsoap_xml(xml_doc) ⇒ Object
-
#initialize(minute = Time.now.min, hour = Time.now.hour, day_of_month = Time.now.day, month = Time.now.month, year = Time.now.year, recurring = @@RECURRING_NONE, notify = 0) ⇒ ConferenceSchedule
constructor
Constructor.
- #to_s ⇒ Object
Constructor Details
#initialize(minute = Time.now.min, hour = Time.now.hour, day_of_month = Time.now.day, month = Time.now.month, year = Time.now.year, recurring = @@RECURRING_NONE, notify = 0) ⇒ ConferenceSchedule
Constructor
15 16 17 18 19 20 21 22 23 |
# File 'lib/conference_call_service/conference_schedule.rb', line 15 def initialize(minute = Time.now.min, hour = Time.now.hour, day_of_month = Time.now.day, month = Time.now.month, year = Time.now.year, recurring = @@RECURRING_NONE, notify = 0) @minute = minute @hour = hour @day_of_month = day_of_month @month = month @year = year @recurring = recurring @notify = notify end |
Instance Attribute Details
#day_of_month ⇒ Object
Returns the value of attribute day_of_month.
6 7 8 |
# File 'lib/conference_call_service/conference_schedule.rb', line 6 def day_of_month @day_of_month end |
#hour ⇒ Object
Returns the value of attribute hour.
6 7 8 |
# File 'lib/conference_call_service/conference_schedule.rb', line 6 def hour @hour end |
#minute ⇒ Object
Returns the value of attribute minute.
6 7 8 |
# File 'lib/conference_call_service/conference_schedule.rb', line 6 def minute @minute end |
#month ⇒ Object
Returns the value of attribute month.
6 7 8 |
# File 'lib/conference_call_service/conference_schedule.rb', line 6 def month @month end |
#notify ⇒ Object
Returns the value of attribute notify.
6 7 8 |
# File 'lib/conference_call_service/conference_schedule.rb', line 6 def notify @notify end |
#recurring ⇒ Object
Returns the value of attribute recurring.
6 7 8 |
# File 'lib/conference_call_service/conference_schedule.rb', line 6 def recurring @recurring end |
#year ⇒ Object
Returns the value of attribute year.
6 7 8 |
# File 'lib/conference_call_service/conference_schedule.rb', line 6 def year @year end |
Class Method Details
.build_from_xml(xml_doc) ⇒ Object
Static methods
42 43 44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/conference_call_service/conference_schedule.rb', line 42 def self.build_from_xml(xml_doc) # If the service responds with non-0000 answer there might me no schedule infos available if xml_doc then minute = ConferenceCallService.xpath_query(xml_doc, "minute").to_s hour = ConferenceCallService.xpath_query(xml_doc, "hour").to_s day_of_month = ConferenceCallService.xpath_query(xml_doc, "dayOfMonth").to_s month = ConferenceCallService.xpath_query(xml_doc, "month").to_s year = ConferenceCallService.xpath_query(xml_doc, "year").to_s recurring = ConferenceCallService.xpath_query(xml_doc, "recurring").to_s notify = ConferenceCallService.xpath_query(xml_doc, "notify").to_s new(minute, hour, day_of_month, month, year, recurring, notify) end end |
.RECURRING_HOURLY ⇒ Object
61 62 63 |
# File 'lib/conference_call_service/conference_schedule.rb', line 61 def self.RECURRING_HOURLY @@RECURRING_HOURLY end |
.RECURRING_MONTHLY ⇒ Object
69 70 71 |
# File 'lib/conference_call_service/conference_schedule.rb', line 69 def self.RECURRING_MONTHLY @@RECURRING_MONTHLY end |
.RECURRING_NONE ⇒ Object
57 58 59 |
# File 'lib/conference_call_service/conference_schedule.rb', line 57 def self.RECURRING_NONE @@RECURRING_NONE end |
.RECURRING_WEEKLY ⇒ Object
65 66 67 |
# File 'lib/conference_call_service/conference_schedule.rb', line 65 def self.RECURRING_WEEKLY @@RECURRING_WEEKLY end |
Instance Method Details
#add_to_handsoap_xml(xml_doc) ⇒ Object
30 31 32 33 34 35 36 37 38 |
# File 'lib/conference_call_service/conference_schedule.rb', line 30 def add_to_handsoap_xml(xml_doc) xml_doc.add('minute', @minute.to_s) xml_doc.add('hour', @hour.to_s) xml_doc.add('dayOfMonth', @day_of_month.to_s) xml_doc.add('month', @month.to_s) xml_doc.add('year', @year.to_s) xml_doc.add('recurring', @recurring.to_s) xml_doc.add('notify', @notify.to_s) end |
#to_s ⇒ Object
25 26 27 28 |
# File 'lib/conference_call_service/conference_schedule.rb', line 25 def to_s ret = "#{year}-#{month}-#{day_of_month} #{hour}:#{minute} Recurring: #{recurring}, Notify: #{notify}\n" ret end |