Class: Instamsg::Resource

Inherits:
Object
  • Object
show all
Defined in:
lib/instamsg/resource.rb

Instance Method Summary collapse

Constructor Details

#initialize(client, path) ⇒ Resource



3
4
5
6
# File 'lib/instamsg/resource.rb', line 3

def initialize(client, path)
  @client = client
  @path = path
end

Instance Method Details

#authenticate(params) ⇒ Object



52
53
54
# File 'lib/instamsg/resource.rb', line 52

def authenticate(params)
  authenticate_request(:post, params).send_sync
end

#delete(params) ⇒ Object



36
37
38
# File 'lib/instamsg/resource.rb', line 36

def delete(params)
  create_request(:delete, params).send_sync
end

#delete_async(params) ⇒ Object



40
41
42
# File 'lib/instamsg/resource.rb', line 40

def delete_async(params)
  create_request(:delete, params).send_async
end

#download(params) ⇒ Object



44
45
46
# File 'lib/instamsg/resource.rb', line 44

def download(params)
  create_request(:post, params).send_sync
end

#get(params) ⇒ Object



8
9
10
# File 'lib/instamsg/resource.rb', line 8

def get(params)
  create_request(:get, params).send_sync
end

#get_async(params) ⇒ Object



12
13
14
# File 'lib/instamsg/resource.rb', line 12

def get_async(params)
  create_request(:get, params).send_async
end

#post(params) ⇒ Object



16
17
18
19
# File 'lib/instamsg/resource.rb', line 16

def post(params)
  body = MultiJson.encode(params)
  create_request(:post, {}, body).send_sync
end

#post_async(params) ⇒ Object



21
22
23
24
# File 'lib/instamsg/resource.rb', line 21

def post_async(params)
  body = MultiJson.encode(params)
  create_request(:post, {}, body).send_async
end

#put(params) ⇒ Object



26
27
28
29
# File 'lib/instamsg/resource.rb', line 26

def put(params)
  body = MultiJson.encode(params)
  create_request(:put, {}, body).send_sync
end

#put_async(params) ⇒ Object



31
32
33
34
# File 'lib/instamsg/resource.rb', line 31

def put_async(params)
  body = MultiJson.encode(params)
  create_request(:put, {}, body).send_async
end

#upload(params) ⇒ Object



48
49
50
# File 'lib/instamsg/resource.rb', line 48

def upload(params)
  create_request(:post, params).upload_sync
end