Class: Utils::Notion::FetchDatabaseRecord

Inherits:
Object
  • Object
show all
Defined in:
lib/bas/utils/notion/fetch_database_record.rb

Overview

This module is a Notion utility for fetching record from a database.

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ FetchDatabaseRecord

Implements the fetch page process logic to Notion.


Params:

  • database_id Id of the notion database.

  • secret Notion secret.

  • body Body with the filters.


returns HTTParty::Response



24
25
26
# File 'lib/bas/utils/notion/fetch_database_record.rb', line 24

def initialize(options)
  @options = options
end

Instance Method Details

#executeObject



28
29
30
31
32
# File 'lib/bas/utils/notion/fetch_database_record.rb', line 28

def execute
  records = Utils::Notion::Request.execute(params)

  records.parsed_response["results"] || []
end