plivo/plivo-ruby — pull request #27 by moserrya (2014-02-23 06:49:20+00:00)
Title: rename User class to avoid namespace collisions

Background
----

When `Plivo` is used as a mixin (as in all of the examples provided), it pollutes the `User` namespace, which means examples like the following will fail:

```ruby
class DailyMessageWorker
include Plivo
def perform
plivo.send_message({'dst' => user.phone_number,
#other params
})
end

def user
User.where(hour_to_message: Time.now.hour).last
end

def plivo
@plivo ||= RestAPI.new(PLIVO_CONFIG[:auth_id], PLIVO_CONFIG[:auth_token])
end
end
```

Plivo will probably be used in the context of background workers. A model likely to have phone numbers is the `User` model, which is common to nearly all Rails applications. Hence namespace collisions seem highly likely.

The change herein addresses this issue.