Class: Dwolla::Users

Inherits:
Object
  • Object
show all
Defined in:
lib/dwolla/users.rb

Class Method Summary collapse

Class Method Details

.get(id = nil, token = nil) ⇒ Object



3
4
5
6
7
8
9
10
11
12
13
14
# File 'lib/dwolla/users.rb', line 3

def self.get(id=nil, token=nil)
    url = users_url

    unless id.nil?
        url += id.to_s
        @oauth = false
    else
        @oauth = token.nil? ? true : token
    end

    Dwolla.request(:get, url, {}, {}, @oauth)
end

.me(token = nil) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/dwolla/users.rb', line 16

def self.me(token=nil)
    # I'm not using the 'alias_method' fn
    # because the .me method should not
    # honor any parameters (i.e. User IDs)
    # passed to it
    self.get(nil, token)
end

.nearby(params = {}) ⇒ Object



24
25
26
27
28
29
30
31
# File 'lib/dwolla/users.rb', line 24

def self.nearby(params={})
  raise MissingParameterError.new('No Latitude Provided') unless params[:latitude]
  raise MissingParameterError.new('No Longitude Provided') unless params[:longitude]

  url = users_url + 'nearby'

  Dwolla.request(:get, url, params, {}, false)
end