Class: PollObject
- Inherits:
-
Object
- Object
- PollObject
- Includes:
- DataFactory, Foundry, StringFactory, Workflows
- Defined in:
- lib/sambal-cle/data_objects/poll.rb
Instance Attribute Summary collapse
-
#access ⇒ Object
Returns the value of attribute access.
-
#closing_date ⇒ Object
Returns the value of attribute closing_date.
-
#instructions ⇒ Object
Returns the value of attribute instructions.
-
#opening_date ⇒ Object
Returns the value of attribute opening_date.
-
#options ⇒ Object
Returns the value of attribute options.
-
#question ⇒ Object
Returns the value of attribute question.
-
#site ⇒ Object
Returns the value of attribute site.
-
#visibility ⇒ Object
Returns the value of attribute visibility.
Instance Method Summary collapse
- #create ⇒ Object
- #delete ⇒ Object
- #edit(opts = {}) ⇒ Object
-
#initialize(browser, opts = {}) ⇒ PollObject
constructor
A new instance of PollObject.
- #view ⇒ Object
Methods included from Workflows
menu_link, #open_my_site_by_name, #reset
Constructor Details
#initialize(browser, opts = {}) ⇒ PollObject
Returns a new instance of PollObject.
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/sambal-cle/data_objects/poll.rb', line 11 def initialize(browser, opts={}) @browser = browser defaults = { :question=>random_alphanums, :options=>[random_alphanums, random_alphanums] } = defaults.merge(opts) () requires @site end |
Instance Attribute Details
#access ⇒ Object
Returns the value of attribute access.
8 9 10 |
# File 'lib/sambal-cle/data_objects/poll.rb', line 8 def access @access end |
#closing_date ⇒ Object
Returns the value of attribute closing_date.
8 9 10 |
# File 'lib/sambal-cle/data_objects/poll.rb', line 8 def closing_date @closing_date end |
#instructions ⇒ Object
Returns the value of attribute instructions.
8 9 10 |
# File 'lib/sambal-cle/data_objects/poll.rb', line 8 def instructions @instructions end |
#opening_date ⇒ Object
Returns the value of attribute opening_date.
8 9 10 |
# File 'lib/sambal-cle/data_objects/poll.rb', line 8 def opening_date @opening_date end |
#options ⇒ Object
Returns the value of attribute options.
8 9 10 |
# File 'lib/sambal-cle/data_objects/poll.rb', line 8 def @options end |
#question ⇒ Object
Returns the value of attribute question.
8 9 10 |
# File 'lib/sambal-cle/data_objects/poll.rb', line 8 def question @question end |
#site ⇒ Object
Returns the value of attribute site.
8 9 10 |
# File 'lib/sambal-cle/data_objects/poll.rb', line 8 def site @site end |
#visibility ⇒ Object
Returns the value of attribute visibility.
8 9 10 |
# File 'lib/sambal-cle/data_objects/poll.rb', line 8 def visibility @visibility end |
Instance Method Details
#create ⇒ Object
24 25 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 |
# File 'lib/sambal-cle/data_objects/poll.rb', line 24 def create open_my_site_by_name @site polls on Polls do |polls| polls.add end on AddEditPoll do |add| add.question.set @question add.enter_source_text add.editor, @instructions # TODO: Need to add the filling out of more fields here add. end on AddAnOption do |page| if @options.length > 1 @options[0..-2].each do |option| page.enter_source_text page.editor, option page. end page.enter_source_text(page.editor, @options[-1]) page.save else page.enter_source_text(page.editor, @options[0]) page.save end end on AddEditPoll do |poll| poll.save end end |
#delete ⇒ Object
63 64 65 |
# File 'lib/sambal-cle/data_objects/poll.rb', line 63 def delete #TODO: Add stuff here end |
#edit(opts = {}) ⇒ Object
54 55 56 57 |
# File 'lib/sambal-cle/data_objects/poll.rb', line 54 def edit opts={} #TODO: Add stuff here (opts) end |
#view ⇒ Object
59 60 61 |
# File 'lib/sambal-cle/data_objects/poll.rb', line 59 def view #TODO: Add stuff here end |