Class: EventObject
- Inherits:
-
Object
- Object
- EventObject
- Includes:
- DataFactory, DateFactory, Foundry, StringFactory, Workflows
- Defined in:
- lib/sambal-cle/data_objects/event.rb
Instance Attribute Summary collapse
-
#day ⇒ Object
Returns the value of attribute day.
-
#duration_hours ⇒ Object
Returns the value of attribute duration_hours.
-
#duration_minutes ⇒ Object
Returns the value of attribute duration_minutes.
-
#end_hour ⇒ Object
Returns the value of attribute end_hour.
-
#end_meridian ⇒ Object
Returns the value of attribute end_meridian.
-
#end_minute ⇒ Object
Returns the value of attribute end_minute.
-
#link ⇒ Object
Returns the value of attribute link.
-
#message ⇒ Object
Returns the value of attribute message.
-
#message_html ⇒ Object
Returns the value of attribute message_html.
-
#month ⇒ Object
Returns the value of attribute month.
-
#site ⇒ Object
Returns the value of attribute site.
-
#start_hour ⇒ Object
Returns the value of attribute start_hour.
-
#start_meridian ⇒ Object
Returns the value of attribute start_meridian.
-
#start_minute ⇒ Object
Returns the value of attribute start_minute.
-
#title ⇒ Object
Returns the value of attribute title.
-
#year ⇒ Object
Returns the value of attribute year.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(browser, opts = {}) ⇒ EventObject
constructor
A new instance of EventObject.
- #view ⇒ Object
Methods included from Workflows
menu_link, #open_my_site_by_name, #reset
Constructor Details
#initialize(browser, opts = {}) ⇒ EventObject
Returns a new instance of EventObject.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/sambal-cle/data_objects/event.rb', line 13 def initialize(browser, opts={}) @browser = browser defaults = { :title=>random_alphanums, :month=>minutes_from_now(15)[:MON], :day=>minutes_from_now(15)[:day_of_month], :year=>minutes_from_now(15)[:year], :start_hour=>minutes_from_now(15)[:hour], :start_minute=>minutes_from_now(15)[:minute_rounded], :start_meridian=>minutes_from_now(15)[:meridian], :message=>random_multiline(400, 20, :lorem) } = defaults.merge(opts) () requires @site end |
Instance Attribute Details
#day ⇒ Object
Returns the value of attribute day.
9 10 11 |
# File 'lib/sambal-cle/data_objects/event.rb', line 9 def day @day end |
#duration_hours ⇒ Object
Returns the value of attribute duration_hours.
9 10 11 |
# File 'lib/sambal-cle/data_objects/event.rb', line 9 def duration_hours @duration_hours end |
#duration_minutes ⇒ Object
Returns the value of attribute duration_minutes.
9 10 11 |
# File 'lib/sambal-cle/data_objects/event.rb', line 9 def duration_minutes @duration_minutes end |
#end_hour ⇒ Object
Returns the value of attribute end_hour.
9 10 11 |
# File 'lib/sambal-cle/data_objects/event.rb', line 9 def end_hour @end_hour end |
#end_meridian ⇒ Object
Returns the value of attribute end_meridian.
9 10 11 |
# File 'lib/sambal-cle/data_objects/event.rb', line 9 def end_meridian @end_meridian end |
#end_minute ⇒ Object
Returns the value of attribute end_minute.
9 10 11 |
# File 'lib/sambal-cle/data_objects/event.rb', line 9 def end_minute @end_minute end |
#link ⇒ Object
Returns the value of attribute link.
9 10 11 |
# File 'lib/sambal-cle/data_objects/event.rb', line 9 def link @link end |
#message ⇒ Object
Returns the value of attribute message.
9 10 11 |
# File 'lib/sambal-cle/data_objects/event.rb', line 9 def @message end |
#message_html ⇒ Object
Returns the value of attribute message_html.
9 10 11 |
# File 'lib/sambal-cle/data_objects/event.rb', line 9 def @message_html end |
#month ⇒ Object
Returns the value of attribute month.
9 10 11 |
# File 'lib/sambal-cle/data_objects/event.rb', line 9 def month @month end |
#site ⇒ Object
Returns the value of attribute site.
9 10 11 |
# File 'lib/sambal-cle/data_objects/event.rb', line 9 def site @site end |
#start_hour ⇒ Object
Returns the value of attribute start_hour.
9 10 11 |
# File 'lib/sambal-cle/data_objects/event.rb', line 9 def start_hour @start_hour end |
#start_meridian ⇒ Object
Returns the value of attribute start_meridian.
9 10 11 |
# File 'lib/sambal-cle/data_objects/event.rb', line 9 def start_meridian @start_meridian end |
#start_minute ⇒ Object
Returns the value of attribute start_minute.
9 10 11 |
# File 'lib/sambal-cle/data_objects/event.rb', line 9 def start_minute @start_minute end |
#title ⇒ Object
Returns the value of attribute title.
9 10 11 |
# File 'lib/sambal-cle/data_objects/event.rb', line 9 def title @title end |
#year ⇒ Object
Returns the value of attribute year.
9 10 11 |
# File 'lib/sambal-cle/data_objects/event.rb', line 9 def year @year end |
Instance Method Details
#create ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/sambal-cle/data_objects/event.rb', line 32 def create open_my_site_by_name @site calendar on Calendar do |cal| cal.add_event end on AddEditEvent do |add_event| add_event.enter_source_text add_event.editor, @message add_event.title.set @title add_event.month.select @month add_event.day.select @day add_event.year.select @year add_event.start_hour.select @start_hour add_event.start_minute.select @start_minute add_event.start_meridian.select @start_meridian if @end_hour == nil && @duration_hours == nil @duration_hours = add_event.hours.value @duration_minutes = add_event.minutes.value @end_hour = add_event.end_hour.value @end_minute = add_event.end_minute.value @end_meridian = add_event.end_meridian.value elsif @end_hour == nil # Todo: Add this later elsif @duration_hours == nil # Todo: Add this later end add_event.save_event end on Calendar do |cal| @link = cal.event_href @title end end |
#view ⇒ Object
65 66 67 68 69 70 71 72 73 74 75 76 |
# File 'lib/sambal-cle/data_objects/event.rb', line 65 def view open_my_site_by_name @site calendar on Calendar do |cal| cal.open_event @title end on EventDetail do |event| @message_html = event. # TODO: Lots of stuff to add here... # ...event.details... end end |