Class: CircleOrbit::Client

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params = {}) ⇒ Client

Returns a new instance of Client.



38
39
40
41
42
43
44
45
# File 'lib/circle_orbit/client.rb', line 38

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"])
  @circle_api_key = params.fetch(:circle_api_key, ENV["CIRCLE_API_KEY"])
  @circle_url = sanitize_url(params.fetch(:circle_url, ENV["CIRCLE_URL"]))
  @circle_community_id = circle_community_id
  @historical_import = params.fetch(:historical_import, false)
end

Instance Attribute Details

#circle_api_keyObject

Returns the value of attribute circle_api_key.



36
37
38
# File 'lib/circle_orbit/client.rb', line 36

def circle_api_key
  @circle_api_key
end

#circle_community_id=(value) ⇒ Object

Sets the attribute circle_community_id

Parameters:

  • value

    the value to set the attribute circle_community_id to.



36
37
38
# File 'lib/circle_orbit/client.rb', line 36

def circle_community_id=(value)
  @circle_community_id = value
end

#circle_urlObject

Returns the value of attribute circle_url.



36
37
38
# File 'lib/circle_orbit/client.rb', line 36

def circle_url
  @circle_url
end

#historical_importObject

Returns the value of attribute historical_import.



36
37
38
# File 'lib/circle_orbit/client.rb', line 36

def historical_import
  @historical_import
end

#orbit_api_keyObject

Returns the value of attribute orbit_api_key.



36
37
38
# File 'lib/circle_orbit/client.rb', line 36

def orbit_api_key
  @orbit_api_key
end

#orbit_workspaceObject

Returns the value of attribute orbit_workspace.



36
37
38
# File 'lib/circle_orbit/client.rb', line 36

def orbit_workspace
  @orbit_workspace
end

Instance Method Details

#commentsObject



58
59
60
61
62
63
64
65
66
67
# File 'lib/circle_orbit/client.rb', line 58

def comments
  CircleOrbit::Circle.new(
    circle_api_key: @circle_api_key,
    circle_url: @circle_url,
    circle_community_id: @circle_community_id,
    orbit_api_key: @orbit_api_key,
    orbit_workspace: @orbit_workspace,
    historical_import: @historical_import
  ).process_comments
end

#postsObject



47
48
49
50
51
52
53
54
55
56
# File 'lib/circle_orbit/client.rb', line 47

def posts
  CircleOrbit::Circle.new(
    circle_api_key: @circle_api_key,
    circle_url: @circle_url,
    circle_community_id: @circle_community_id,
    orbit_api_key: @orbit_api_key,
    orbit_workspace: @orbit_workspace,
    historical_import: @historical_import
  ).process_posts
end