class DevOrbit::Client

Attributes

dev_api_key[RW]
dev_organization[RW]
dev_username[RW]
historical_import[RW]
orbit_api_key[RW]
orbit_workspace[RW]

Public Class Methods

new(params = {}) click to toggle source
# File lib/dev_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"])
  @dev_api_key = params.fetch(:dev_api_key, ENV["DEV_API_KEY"])
  @dev_username = params.fetch(:dev_username, ENV["DEV_USERNAME"])
  @dev_organization = params.fetch(:dev_organization, ENV["DEV_ORGANIZATION"])
  @historical_import = params.fetch(:historical_import, false)
end

Public Instance Methods

comments(type: "user") click to toggle source

Fetch new comments from DEV and post them to the Orbit workspace

# File lib/dev_orbit/client.rb, line 47
def comments(type: "user")
  DevOrbit::Dev.new(
    api_key: @dev_api_key,
    username: @dev_username,
    workspace_id: @orbit_workspace,
    orbit_api_key: @orbit_api_key,
    historical_import: @historical_import
  ).process_comments(type: type)
end
followers() click to toggle source
# File lib/dev_orbit/client.rb, line 57
def followers
  DevOrbit::Dev.new(
    api_key: @dev_api_key,
    username: @dev_username,
    workspace_id: @orbit_workspace,
    orbit_api_key: @orbit_api_key
  ).process_followers
end
orbit() click to toggle source
# File lib/dev_orbit/client.rb, line 75
def orbit
  DevOrbit::Orbit.new
end
organization_comments(type: "organization") click to toggle source
# File lib/dev_orbit/client.rb, line 66
def organization_comments(type: "organization")
  DevOrbit::Dev.new(
    api_key: @dev_api_key,
    organization: @dev_organization,
    workspace_id: @orbit_workspace,
    orbit_api_key: @orbit_api_key
  ).process_comments(type: type)
end