Class: NotionOrbit::Client
- Inherits:
-
Object
- Object
- NotionOrbit::Client
- Defined in:
- lib/notion_orbit/client.rb
Instance Attribute Summary collapse
-
#notion_api_key ⇒ Object
Returns the value of attribute notion_api_key.
-
#notion_database_id ⇒ Object
Returns the value of attribute notion_database_id.
-
#notion_workspace_slug ⇒ Object
Returns the value of attribute notion_workspace_slug.
-
#orbit_api_key ⇒ Object
Returns the value of attribute orbit_api_key.
-
#orbit_workspace ⇒ Object
Returns the value of attribute orbit_workspace.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Client
constructor
A new instance of Client.
- #notes ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Client
Returns a new instance of Client.
37 38 39 40 41 42 43 |
# File 'lib/notion_orbit/client.rb', line 37 def initialize(params = {}) @orbit_api_key = params.fetch(:orbit_api_key, ENV["ORBIT_API_KEY"]) @orbit_workspace = params.fetch(:orbit_workspace, ENV["ORBIT_WORKSPACE_ID"]) @notion_api_key = params.fetch(:notion_api_key, ENV["NOTION_API_KEY"]) @notion_database_id = params.fetch(:notion_database_id, ENV["NOTION_DATABASE_ID"]) @notion_workspace_slug = params.fetch(:notion_workspace_slug, ENV["NOTION_WORKSPACE_SLUG"]) end |
Instance Attribute Details
#notion_api_key ⇒ Object
Returns the value of attribute notion_api_key.
35 36 37 |
# File 'lib/notion_orbit/client.rb', line 35 def notion_api_key @notion_api_key end |
#notion_database_id ⇒ Object
Returns the value of attribute notion_database_id.
35 36 37 |
# File 'lib/notion_orbit/client.rb', line 35 def notion_database_id @notion_database_id end |
#notion_workspace_slug ⇒ Object
Returns the value of attribute notion_workspace_slug.
35 36 37 |
# File 'lib/notion_orbit/client.rb', line 35 def notion_workspace_slug @notion_workspace_slug end |
#orbit_api_key ⇒ Object
Returns the value of attribute orbit_api_key.
35 36 37 |
# File 'lib/notion_orbit/client.rb', line 35 def orbit_api_key @orbit_api_key end |
#orbit_workspace ⇒ Object
Returns the value of attribute orbit_workspace.
35 36 37 |
# File 'lib/notion_orbit/client.rb', line 35 def orbit_workspace @orbit_workspace end |
Instance Method Details
#notes ⇒ Object
45 46 47 48 49 50 51 52 53 |
# File 'lib/notion_orbit/client.rb', line 45 def notes NotionOrbit::Notion.new( orbit_api_key: @orbit_api_key, orbit_workspace: @orbit_workspace, notion_api_key: @notion_api_key, notion_database_id: @notion_database_id, notion_workspace_slug: @notion_workspace_slug ).process_notes end |