Module: Vk::DSL::Photos
- Included in:
- Vk::DSL
- Defined in:
- lib/vk/dsl/photos.rb
Instance Method Summary collapse
- #get_album(owner_id, album_id, options = {}) ⇒ Vk::Album
- #get_albums(owner_id, options = {}) ⇒ Vk::Result<Vk::Album>
- #get_photos(owner_id, album_id, options = {}) ⇒ Vk::Result<Vk::Photo>
Instance Method Details
#get_album(owner_id, album_id, options = {}) ⇒ Vk::Album
22 23 24 25 |
# File 'lib/vk/dsl/photos.rb', line 22 def get_album(owner_id, album_id, = {}) [:album_ids] = album_id get_albums(owner_id, ).all.first end |
#get_albums(owner_id, options = {}) ⇒ Vk::Result<Vk::Album>
11 12 13 14 15 16 17 18 19 |
# File 'lib/vk/dsl/photos.rb', line 11 def get_albums(owner_id, = {}) [:owner_id] = owner_id [:need_system] = !![:need_system] ? 1 : 0 if .key?(:need_system) [:photo_sizes] = !![:photo_sizes] ? 1 : 0 if .key?(:photo_sizes) [:need_covers] = !![:need_covers] ? 1 : 0 if .key?(:need_covers) [:album_ids] = Array([:album_ids]).map(&:to_s).join(',') if .key?(:album_ids) require 'vk/album' Vk::Result.new('photos.getAlbums', Vk::Album, ) end |
#get_photos(owner_id, album_id, options = {}) ⇒ Vk::Result<Vk::Photo>
28 29 30 31 32 33 |
# File 'lib/vk/dsl/photos.rb', line 28 def get_photos(owner_id, album_id, = {}) [:owner_id] = owner_id [:album_id] = album_id require 'vk/photo' Vk::Result.new('photos.get', Vk::Photo, ) end |