Class: Nocion::Database
- Inherits:
-
Object
- Object
- Nocion::Database
- Defined in:
- lib/nocion.rb
Defined Under Namespace
Classes: Page
Instance Method Summary collapse
-
#initialize(key: Config.key, id: nil) ⇒ Database
constructor
A new instance of Database.
- #query ⇒ Object
- #retrieve ⇒ Object
Constructor Details
Instance Method Details
#query ⇒ Object
21 22 23 24 25 26 27 28 |
# File 'lib/nocion.rb', line 21 def query return @pages if @pages @pages = [] @start_cursor = nil @has_more = true _query while @has_more @pages end |
#retrieve ⇒ Object
17 18 19 |
# File 'lib/nocion.rb', line 17 def retrieve resp = RestClient.get("https://api.notion.com/v1/databases/#{@id}", @header) end |