Api

36 views
Skip to first unread message

Arek Rekita

unread,
Nov 6, 2014, 11:57:55 AM11/6/14
to pollevery...@googlegroups.com
I have problem with pooleverywhere method to access to pools:

require 'polleverywhere'
 
# Specify your username and password here
PollEverywhere.config do
  username  "my_username"
  password  "my_password"
end
works
# Create a multiple choice poll
mcp = PollEverywhere::MultipleChoicePoll.new
mcp.title = 'Do you love numbers?'
mcp.options = %w[1 2 3]
mcp.save
works 
 
# Create a free text poll
ftp = PollEverywhere::FreeTextPoll.new
ftp.title = 'What is your favorite thing about vacation?'
ftp.save
works
 
# Now start playing! Get a list of your polls
polls = PollEverywhere::Poll.all
doesn't works
 
console output:
NameError: uninitialized constant PollEverywhere::Poll
        from (irb):39
        from C:/Ruby21/bin/irb:11:in `<main>'
 
# ... or grab a specific poll
mcp2 = PollEverywhere::MultipleChoicePoll.get(':permalink')
doesn't works
 
console output:
NameError: uninitialized constant PollEverywhere::Poll
        from (irb):39
        from C:/Ruby21/bin/irb:11:in `<main>'
 

windows 7 64 bit
ruby 2.1.4 64 bit

Thanks,
Arek

Paul Poll Everywhere

unread,
Nov 6, 2014, 6:51:49 PM11/6/14
to pollevery...@googlegroups.com


On Thursday, November 6, 2014 8:57:55 AM UTC-8, Arek Rekita wrote:
polls = PollEverywhere::Poll.all
doesn't works
 
console output:
NameError: uninitialized constant PollEverywhere::Poll
        from (irb):39
        from C:/Ruby21/bin/irb:11:in `<main>'
 
# ... or grab a specific poll
mcp2 = PollEverywhere::MultipleChoicePoll.get(':permalink')
doesn't works
 
console output:
NameError: uninitialized constant PollEverywhere::Poll
        from (irb):39
        from C:/Ruby21/bin/irb:11:in `<main>'


I just published version 0.0.18, which should address this problem. If you are not able to upgrade, a workaround is to reference these classes directly via
PollEverywhere::Models::MultipleChoicePoll and PollEverywhere::Models::Poll rather than via the shortcuts described in the readme.
Reply all
Reply to author
Forward
0 new messages