Class: NotionOrbit::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/notion_orbit/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_keyObject

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_idObject

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_slugObject

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_keyObject

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_workspaceObject

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

#notesObject



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