class MailRU::API

Constants

PARAMS
PATH

Public Class Methods

new(options = {}) { |self| ... } click to toggle source
# File lib/mailru/api.rb, line 6
def initialize options = {}, &block
  @configuration = options

  if block_given?
    if block.arity == 1
      yield self
    else
      @configuration.merge! ConfigurationBuilder.new(&block).configuration
    end
  end
end

Public Instance Methods

audio() click to toggle source
# File lib/mailru/api.rb, line 38
def audio
  DSL.new(self, 'audio') do
    api 'get', :post
    api 'link'
    api 'search', :post
    api 'top', :get, Request::Secure::No
  end
end
events() click to toggle source
# File lib/mailru/api.rb, line 47
def events
  DSL.new(self, 'events') do
    api 'getNewCount'
  end
end
friends() click to toggle source
# File lib/mailru/api.rb, line 53
def friends
  DSL.new(self, 'friends') do
    api 'get'
    api 'getAppUsers'
    api 'getInvitationsCount'
    api 'getOnline'
  end
end
get(name, params = {}) click to toggle source
# File lib/mailru/api.rb, line 30
def get name, params = {}, secure = Request::Secure::Any
  GetRequest.new(self, name, params, secure).get
end
guestbook() click to toggle source
# File lib/mailru/api.rb, line 62
def guestbook
  DSL.new(self, 'guestbook') do
    api 'get'
    api 'post', :post
  end
end
mail() click to toggle source
# File lib/mailru/api.rb, line 69
def mail
  DSL.new(self, 'mail') do
    api 'getUnreadCount'
  end
end
messages() click to toggle source
# File lib/mailru/api.rb, line 75
def messages
  DSL.new(self, 'messages') do
    api 'getThread'
    api 'getThreadsList'
    api 'getUnreadCount'
    api 'post', :post
  end
end
mobile() click to toggle source
# File lib/mailru/api.rb, line 84
def mobile
  DSL.new(self, 'mobile') do
    api 'getCanvas', :get, Request::Secure::No
  end
end
notifications() click to toggle source
# File lib/mailru/api.rb, line 90
def notifications
  DSL.new(self, 'notifications') do
    api 'send', :post, Request::Secure::Yes
  end
end
photos() click to toggle source
# File lib/mailru/api.rb, line 96
def photos
  DSL.new(self, 'photos')  do
    api 'createAlbum', :post
    api 'get', :post
    api 'getAlbums', :post
    api 'upload', :post
  end
end
post(name, params = {}) click to toggle source
# File lib/mailru/api.rb, line 34
def post name, params = {}, secure = Request::Secure::Any
  PostRequest.new(self, name, params, secure).post
end
stream() click to toggle source
# File lib/mailru/api.rb, line 105
def stream
  DSL.new(self, 'stream') do
    api 'comment', :post
    api 'get'
    api 'getByAuthor'
    api 'like'
    api 'post', :post
    api 'share', :post
    api 'unlike'
  end
end
users() click to toggle source
# File lib/mailru/api.rb, line 117
def users
  DSL.new(self, 'users') do
    api 'getBalance'
    api 'getInfo', :post
    api 'hasAppPermission'
    api 'isAppUser'
  end
end