Class: Odnoklassniki::REST::Mediatopic::Photoalbum

Inherits:
Object
  • Object
show all
Defined in:
lib/odnoklassniki/rest/mediatopic/photoalbum.rb

Constant Summary collapse

GET_ALBUMS_METHOD =
'photos.getAlbums'
CREATE_ALBUM_METHOD =
'photos.createAlbum'
GET_ALBUM_UPLOAD_URL_METHOD =
'photosV2.getUploadUrl'
COMMIT_PHOTO_METHOD =
'photosV2.commit'
ALBUM_NAME =
'apiok'
ALBUM_CREATION_OPTIONS =
{
  title: ALBUM_NAME,
  description: 'Album for uploads from odnoklassniki api gem',
  type: 'public'
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Photoalbum

Options: account: { id: Identifier for account in OK,

type: :group/:personal }

client: Client for specified account



30
31
32
33
34
# File 'lib/odnoklassniki/rest/mediatopic/photoalbum.rb', line 30

def initialize(options)
  @options = Odnoklassniki::Utils._symbolize_keys(options)
  @account = @options[:account]
  @api = @options[:client]
end

Instance Attribute Details

#paramsObject

Returns the value of attribute params.



24
25
26
# File 'lib/odnoklassniki/rest/mediatopic/photoalbum.rb', line 24

def params
  @params
end

Instance Method Details

#upload(photo) ⇒ Object



36
37
38
# File 'lib/odnoklassniki/rest/mediatopic/photoalbum.rb', line 36

def upload(photo)
  upload_photoalbum_photo(photo)
end