Method: Osm::Api#initialize
- Defined in:
- lib/osm/api.rb
#initialize(user_id, secret, site = @@site) ⇒ Object
Initialize a new API connection
71 72 73 74 75 76 77 78 79 |
# File 'lib/osm/api.rb', line 71 def initialize(user_id, secret, site=@@site) raise ArgumentError, 'You must pass a secret (get this by using the authorize method)' if secret.nil? raise ArgumentError, 'You must pass a user_id (get this by using the authorize method)' if user_id.nil? raise ArgumentError, 'site is invalid, if passed it should be either :osm or :ogm, if not passed then you forgot to run Api.configure' unless [:osm, :ogm].include?(site) @site = site set_user(user_id, secret) nil end |