vk_api_simple 0.2.3 → 0.2.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d84ddd05a8e21a9d8a039be2a210be22f489101b6bcf648922717a713c8e1833
4
- data.tar.gz: ef1f9173250f64a686fe1550fe39bde8c06b799c38e5d1f88bde506954d3777a
3
+ metadata.gz: 3ba229ee20b2af50dcd4dd08c00f81bb56528edf743493185a36997357429448
4
+ data.tar.gz: 8f1ef5b72c1217a3eee5b7cbec034f38dcfe6b126d008bf711c9871e7ace3d2f
5
5
  SHA512:
6
- metadata.gz: 755dfc81de1c399793d747811c8b83ba749eab4c1131674ab65f6db0768c8d17de35c3077f9fc16fd80dfbbcfeea9bfb86f7675a8eef55176039ebb82cac4b96
7
- data.tar.gz: 572ce603e561aecf3ec4785f0162868c871e98f4e733f838e7aef50a41019695203a27cedf1fff488ec6482ddf7138feda77d48038b83469331015a198c62a56
6
+ metadata.gz: 8501f0ffed53b88514ee0f6a82ff070aca0f34e8b14ca572c645715020ad3f639999d28ff90eb6c59b980ee7a48f8a741226af0c6d799d01082da962cfb987e0
7
+ data.tar.gz: c33af624039771bb6cd28f915a92e1cf2b1055ffb5f9ce621892a2b127e9936f9663cf6e99068752fca932e31a21ebfac76c3e8ed6e2364f780528dccd268cb2
@@ -1,11 +1,15 @@
1
1
  require 'rest-client'
2
2
  require 'json'
3
3
  require_relative 'market/add'
4
+ require_relative 'market/delete'
5
+ require_relative 'market/edit'
4
6
 
5
7
  module VkApiSimple
6
8
  # Market requests
7
9
  class Market
8
10
  include VkApiSimple::Market::Add
11
+ include VkApiSimple::Market::Delete
12
+ include VkApiSimple::Market::Edit
9
13
 
10
14
  BASE_URI = 'https://api.vk.com/method/market.'.freeze
11
15
  VK_API_VERSION = '5.74'.freeze
@@ -0,0 +1,11 @@
1
+ module VkApiSimple
2
+ class Market
3
+ # Delete image from market
4
+ module Delete
5
+ def delete(args = {})
6
+ response = RestClient.get("#{BASE_URI}delete?access_token=#{token}&owner_id=-#{args[:owner_id]}&item_id=#{args[:item_id]}&v=#{api_version}")
7
+ JSON.parse(response.body)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module VkApiSimple
2
+ class Market
3
+ # Edit image in the market
4
+ module Edit
5
+ def edit(args = {})
6
+ response = RestClient.post("#{BASE_URI}edit?access_token=#{token}&owner_id=-#{args[:owner_id]}&item_id=#{args[:item_id]}&category_id=#{args[:category_id]}&price=#{args[:price]}&main_photo_id=#{args[:main_photo_id]}&v=#{api_version}", name: args[:name], description: args[:description])
7
+ JSON.parse(response.body)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,7 +1,11 @@
1
1
  require 'rest-client'
2
2
  require 'json'
3
+ require_relative 'photos/delete'
4
+ require_relative 'photos/edit'
5
+ require_relative 'photos/get'
3
6
  require_relative 'photos/get_market_upload_server'
4
7
  require_relative 'photos/get_upload_server'
8
+ require_relative 'photos/move'
5
9
  require_relative 'photos/save'
6
10
  require_relative 'photos/save_market_photo'
7
11
  require_relative 'photos/upload_image'
@@ -9,8 +13,12 @@ require_relative 'photos/upload_image'
9
13
  module VkApiSimple
10
14
  # Clients requests
11
15
  class Photos
16
+ include VkApiSimple::Photos::Delete
17
+ include VkApiSimple::Photos::Edit
18
+ include VkApiSimple::Photos::Get
12
19
  include VkApiSimple::Photos::GetMarketUploadServer
13
20
  include VkApiSimple::Photos::GetUploadServer
21
+ include VkApiSimple::Photos::Move
14
22
  include VkApiSimple::Photos::Save
15
23
  include VkApiSimple::Photos::SaveMarketPhoto
16
24
  include VkApiSimple::Photos::UploadImage
@@ -0,0 +1,11 @@
1
+ module VkApiSimple
2
+ class Photos
3
+ # Delete image from server
4
+ module Delete
5
+ def delete(args = {})
6
+ response = RestClient.get("#{BASE_URI}delete?access_token=#{token}&owner_id=-#{args[:owner_id]}&photo_id=#{args[:photo_id]}&v=#{api_version}")
7
+ JSON.parse(response.body)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module VkApiSimple
2
+ class Photos
3
+ # Edit image at server
4
+ module Edit
5
+ def edit(args = {})
6
+ response = RestClient.post("#{BASE_URI}edit?access_token=#{token}&owner_id=-#{args[:owner_id]}&photo_id=#{args[:photo_id]}&v=#{api_version}", caption: args[:caption])
7
+ JSON.parse(response.body)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module VkApiSimple
2
+ class Photos
3
+ # Get photos from server
4
+ module Get
5
+ def get(args = {})
6
+ response = RestClient.get("#{BASE_URI}get?access_token=#{token}&album_id=#{args[:album_id]}&owner_id=#{args[:group_id]}&count=#{args[:count]}&v=#{api_version}")
7
+ JSON.parse(response.body)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -0,0 +1,11 @@
1
+ module VkApiSimple
2
+ class Photos
3
+ # Move photo to another album
4
+ module Move
5
+ def move(args = {})
6
+ response = RestClient.get("#{BASE_URI}move?access_token=#{token}&owner_id=-#{args[:owner_id]}&target_album_id=#{args[:target_album_id]}&photo_id=#{args[:photo_id]}&v=#{api_version}")
7
+ JSON.parse(response.body)
8
+ end
9
+ end
10
+ end
11
+ end
@@ -1,3 +1,3 @@
1
1
  module VkApiSimple
2
- VERSION = '0.2.3'.freeze
2
+ VERSION = '0.2.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vk_api_simple
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - kortirso
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-05-06 00:00:00.000000000 Z
11
+ date: 2018-05-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -101,9 +101,15 @@ files:
101
101
  - lib/vk_api_simple.rb
102
102
  - lib/vk_api_simple/market.rb
103
103
  - lib/vk_api_simple/market/add.rb
104
+ - lib/vk_api_simple/market/delete.rb
105
+ - lib/vk_api_simple/market/edit.rb
104
106
  - lib/vk_api_simple/photos.rb
107
+ - lib/vk_api_simple/photos/delete.rb
108
+ - lib/vk_api_simple/photos/edit.rb
109
+ - lib/vk_api_simple/photos/get.rb
105
110
  - lib/vk_api_simple/photos/get_market_upload_server.rb
106
111
  - lib/vk_api_simple/photos/get_upload_server.rb
112
+ - lib/vk_api_simple/photos/move.rb
107
113
  - lib/vk_api_simple/photos/save.rb
108
114
  - lib/vk_api_simple/photos/save_market_photo.rb
109
115
  - lib/vk_api_simple/photos/upload_image.rb