Class: Netbout::Inbox
- Inherits:
-
Object
- Object
- Netbout::Inbox
- Defined in:
- lib/netbout/inbox.rb
Overview
Inbox.
- Author
-
Yegor Bugayenko ([email protected])
- Copyright
-
Copyright © 2024 Yegor Bugayenko
- License
-
MIT
Instance Method Summary collapse
- #identity ⇒ Object
-
#initialize(token) ⇒ Inbox
constructor
A new instance of Inbox.
- #search(query = '') ⇒ Object
- #start(title) ⇒ Object
- #take(id) ⇒ Object
Constructor Details
#initialize(token) ⇒ Inbox
Returns a new instance of Inbox.
35 36 37 38 39 |
# File 'lib/netbout/inbox.rb', line 35 def initialize(token) require_relative 'http' @token = token @iri = Iri.new('https://netbout.com') end |
Instance Method Details
#identity ⇒ Object
41 42 43 44 45 |
# File 'lib/netbout/inbox.rb', line 41 def identity rsp = Netbout::Http.new(@iri.append('/self'), @token).get json = JSON.parse(rsp.response_body) json['identity'] end |
#search(query = '') ⇒ Object
47 48 49 |
# File 'lib/netbout/inbox.rb', line 47 def search(query = '') Netbout::Search.new(@iri, @token, query) end |