Class: Notion::Client

Inherits:
Object
  • Object
show all
Includes:
Api::Endpoints, Faraday::Connection, Faraday::Request
Defined in:
lib/notion/client.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Api::Endpoints::Comments

#create_comment, #retrieve_comments

Methods included from Api::Endpoints::Search

#search

Methods included from Api::Endpoints::Users

#me, #user, #users_list

Methods included from Api::Endpoints::Pages

#create_page, #page, #page_property_item, #update_page

Methods included from Api::Endpoints::Databases

#create_database, #database, #database_query, #update_database

Methods included from Api::Endpoints::Blocks

#block, #block_append_children, #block_children, #delete_block, #update_block

Methods included from Faraday::Request

#delete, #get, #patch, #post, #put

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



10
11
12
13
14
15
16
# File 'lib/notion/client.rb', line 10

def initialize(options = {})
  Notion::Config::ATTRIBUTES.each do |key|
    send("#{key}=", options.fetch(key, Notion.config.send(key)))
  end
  @logger ||= Notion::Config.logger || Notion::Logger.default
  @token ||= Notion.config.token
end

Class Method Details

.configObject



23
24
25
# File 'lib/notion/client.rb', line 23

def config
  Config
end

.configureObject



19
20
21
# File 'lib/notion/client.rb', line 19

def configure
  block_given? ? yield(Config) : Config
end