Class: TinderPyro::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/pyro/client.rb

Instance Method Summary collapse

Constructor Details

#initializeClient

Returns a new instance of Client.



3
4
5
# File 'lib/pyro/client.rb', line 3

def initialize
  @requestor = Requestor.new
end

Instance Method Details

#dislike(user_id) ⇒ Object



7
8
9
# File 'lib/pyro/client.rb', line 7

def dislike(user_id)
  @requestor.get_request("pass/#{user_id}")
end

#fetch_updates(last_activity_time = Time.now) ⇒ Object



11
12
13
14
15
16
# File 'lib/pyro/client.rb', line 11

def fetch_updates(last_activity_time = Time.now)
  @requestor.post_request(
    :updates,
    last_activity_date: Utilities.format_time(last_activity_time)
  )
end

#get_nearby_usersObject



18
19
20
# File 'lib/pyro/client.rb', line 18

def get_nearby_users
  @requestor.get_request('user/recs')
end

#info_for_user(user_id) ⇒ Object



22
23
24
# File 'lib/pyro/client.rb', line 22

def info_for_user(user_id)
  @requestor.get_request("user/#{user_id}")
end

#like(user_id) ⇒ Object



26
27
28
# File 'lib/pyro/client.rb', line 26

def like(user_id)
  @requestor.get_request("like/#{user_id}")
end

#profileObject



30
31
32
# File 'lib/pyro/client.rb', line 30

def profile
  @requestor.get_request(:profile)
end

#send_message(user_id, message) ⇒ Object



34
35
36
37
38
39
# File 'lib/pyro/client.rb', line 34

def send_message(user_id, message)
  @requestor.post_request(
    "user/matches/#{user_id}",
    message: message
  )
end

#sign_in(facebook_id, facebook_token) ⇒ Object



41
42
43
# File 'lib/pyro/client.rb', line 41

def (facebook_id, facebook_token)
  @requestor.auth_request(facebook_id, facebook_token)
end

#update_location(latitude, longitude) ⇒ Object



45
46
47
# File 'lib/pyro/client.rb', line 45

def update_location(latitude, longitude)
  @requestor.post_request("user/ping", lat: latitude, lon: longitude)
end