Class: MailRU::API
- Inherits:
-
Object
- Object
- MailRU::API
- Defined in:
- lib/mailru-api.rb,
lib/mailru-api/mail.rb,
lib/mailru-api/audio.rb,
lib/mailru-api/error.rb,
lib/mailru-api/users.rb,
lib/mailru-api/events.rb,
lib/mailru-api/mobile.rb,
lib/mailru-api/photos.rb,
lib/mailru-api/stream.rb,
lib/mailru-api/friends.rb,
lib/mailru-api/request.rb,
lib/mailru-api/guestbook.rb,
lib/mailru-api/notifications.rb
Defined Under Namespace
Modules: Format Classes: AccessToObjectDeniedError, ApplicationIsNotInstalledError, ApplicationLookupFailedError, Audio, AuthorizationFailedError, Error, Events, Friends, GetRequest, Guestbook, IncorrectImageError, IncorrectSignatureError, InvalidParameterError, Mail, MethodIsDeprecatedError, Mobile, Notifications, PermissionDeniedError, Photos, PostRequest, Request, Stream, UnknownError, UnknownMethodCalledError, Users
Constant Summary collapse
- PATH =
'http://www.appsmail.ru/platform/api'
Instance Attribute Summary collapse
-
#app_id ⇒ Object
Returns the value of attribute app_id.
-
#format ⇒ Object
Returns the value of attribute format.
-
#private_key ⇒ Object
Returns the value of attribute private_key.
-
#secret_key ⇒ Object
Returns the value of attribute secret_key.
-
#session_key ⇒ Object
Returns the value of attribute session_key.
-
#uid ⇒ Object
Returns the value of attribute uid.
Instance Method Summary collapse
- #audio ⇒ Object
- #events ⇒ Object
- #friends ⇒ Object
- #guestbook ⇒ Object
-
#initialize(options = {}, &block) ⇒ API
constructor
A new instance of API.
- #mail ⇒ Object
- #messages ⇒ Object
- #mobile ⇒ Object
- #notifications ⇒ Object
- #photos ⇒ Object
- #stream ⇒ Object
- #users ⇒ Object
Constructor Details
#initialize(options = {}, &block) ⇒ API
Returns a new instance of API.
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 |
# File 'lib/mailru-api.rb', line 66 def initialize = {}, &block @app_id = [:app_id] @secret_key = [:secret_key] @private_key = [:private_key] @session_key = [:session_key] @uid = [:uid] @format = [:format] if block_given? if block.arity == 1 yield self else configuration = APIConfigurationBuilder.new(&block).configuration unless configuration.nil? @app_id = configuration.app_id || @app_id @secret_key = configuration.secret_key || @secret_key @private_key = configuration.private_key || @private_key @session_key = configuration.session_key || @session_key @uid = configuration.uid || @uid @format = configuration.format || @format end end end end |
Instance Attribute Details
#app_id ⇒ Object
Returns the value of attribute app_id.
64 65 66 |
# File 'lib/mailru-api.rb', line 64 def app_id @app_id end |
#format ⇒ Object
Returns the value of attribute format.
64 65 66 |
# File 'lib/mailru-api.rb', line 64 def format @format end |
#private_key ⇒ Object
Returns the value of attribute private_key.
64 65 66 |
# File 'lib/mailru-api.rb', line 64 def private_key @private_key end |
#secret_key ⇒ Object
Returns the value of attribute secret_key.
64 65 66 |
# File 'lib/mailru-api.rb', line 64 def secret_key @secret_key end |
#session_key ⇒ Object
Returns the value of attribute session_key.
64 65 66 |
# File 'lib/mailru-api.rb', line 64 def session_key @session_key end |
#uid ⇒ Object
Returns the value of attribute uid.
64 65 66 |
# File 'lib/mailru-api.rb', line 64 def uid @uid end |
Instance Method Details
#events ⇒ Object
96 97 98 |
# File 'lib/mailru-api.rb', line 96 def events return Events.new(self) end |
#friends ⇒ Object
100 101 102 |
# File 'lib/mailru-api.rb', line 100 def friends return Friends.new(self) end |
#guestbook ⇒ Object
104 105 106 |
# File 'lib/mailru-api.rb', line 104 def guestbook return Guestbook.new(self) end |
#messages ⇒ Object
112 113 114 |
# File 'lib/mailru-api.rb', line 112 def return Messages.new(self) end |
#mobile ⇒ Object
116 117 118 |
# File 'lib/mailru-api.rb', line 116 def mobile return Mobile.new(self) end |
#notifications ⇒ Object
120 121 122 |
# File 'lib/mailru-api.rb', line 120 def notifications return Notifications.new(self) end |
#photos ⇒ Object
124 125 126 |
# File 'lib/mailru-api.rb', line 124 def photos return Photos.new(self) end |