Class: MixinBot::API
- Inherits:
-
Object
- Object
- MixinBot::API
- Defined in:
- lib/mixin_bot/api.rb,
lib/mixin_bot/api/me.rb,
lib/mixin_bot/api/pin.rb,
lib/mixin_bot/api/auth.rb,
lib/mixin_bot/api/user.rb,
lib/mixin_bot/api/message.rb,
lib/mixin_bot/api/payment.rb,
lib/mixin_bot/api/snapshot.rb,
lib/mixin_bot/api/transfer.rb,
lib/mixin_bot/api/withdraw.rb,
lib/mixin_bot/api/conversation.rb
Defined Under Namespace
Modules: Auth, Conversation, Me, Message, Payment, Pin, Snapshot, Transfer, User, Withdraw
Instance Attribute Summary collapse
-
#client ⇒ Object
readonly
Returns the value of attribute client.
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
readonly
Returns the value of attribute client_secret.
-
#pin_token ⇒ Object
readonly
Returns the value of attribute pin_token.
-
#private_key ⇒ Object
readonly
Returns the value of attribute private_key.
-
#session_id ⇒ Object
readonly
Returns the value of attribute session_id.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ API
constructor
A new instance of API.
Methods included from Withdraw
#create_withdraw_address, #delete_withdraw_address, #get_withdraw_address, #withdrawals
Methods included from User
#create_user, #fetch_users, #generate_rsa_key, #read_user, #search_user
Methods included from Transfer
#create_transfer, #read_transfer
Methods included from Snapshot
#read_snapshot, #read_snapshots
Methods included from Pin
#decrypt_pin, #encrypt_pin, #update_pin, #verify_pin
Methods included from Payment
Methods included from Message
#acknowledge_message_receipt, #app_button_group, #app_card, #base_message_params, #list_pending_message, #plain_contact, #plain_data, #plain_image, #plain_sticker, #plain_text, #plain_video, #read_ws_message, #send_app_button_group_message, #send_app_card_message, #send_contact_message, #send_message, #send_plain_messages, #send_text_message, #write_ws_message
Methods included from Me
#read_asset, #read_assets, #read_friends, #read_me, #update_me
Methods included from Conversation
#create_contact_conversation, #read_conversation, #read_conversation_by_user_id, #unique_conversation_id
Methods included from Auth
#access_token, #oauth_token, #request_oauth
Constructor Details
#initialize(options = {}) ⇒ API
Returns a new instance of API.
21 22 23 24 25 26 27 28 |
# File 'lib/mixin_bot/api.rb', line 21 def initialize( = {}) @client_id = [:client_id] || MixinBot.client_id @client_secret = [:client_secret] || MixinBot.client_secret @session_id = [:session_id] || MixinBot.session_id @pin_token = Base64.decode64 [:pin_token] || MixinBot.pin_token @private_key = OpenSSL::PKey::RSA.new [:private_key] || MixinBot.private_key @client = Client.new end |
Instance Attribute Details
#client ⇒ Object (readonly)
Returns the value of attribute client.
19 20 21 |
# File 'lib/mixin_bot/api.rb', line 19 def client @client end |
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
18 19 20 |
# File 'lib/mixin_bot/api.rb', line 18 def client_id @client_id end |
#client_secret ⇒ Object (readonly)
Returns the value of attribute client_secret.
18 19 20 |
# File 'lib/mixin_bot/api.rb', line 18 def client_secret @client_secret end |
#pin_token ⇒ Object (readonly)
Returns the value of attribute pin_token.
18 19 20 |
# File 'lib/mixin_bot/api.rb', line 18 def pin_token @pin_token end |
#private_key ⇒ Object (readonly)
Returns the value of attribute private_key.
18 19 20 |
# File 'lib/mixin_bot/api.rb', line 18 def private_key @private_key end |
#session_id ⇒ Object (readonly)
Returns the value of attribute session_id.
18 19 20 |
# File 'lib/mixin_bot/api.rb', line 18 def session_id @session_id end |