Class: CircleOrbit::Client
- Inherits:
-
Object
- Object
- CircleOrbit::Client
- Defined in:
- lib/circle_orbit/client.rb
Instance Attribute Summary collapse
-
#circle_api_key ⇒ Object
Returns the value of attribute circle_api_key.
-
#circle_community_id ⇒ Object
writeonly
Sets the attribute circle_community_id.
-
#circle_url ⇒ Object
Returns the value of attribute circle_url.
-
#historical_import ⇒ Object
Returns the value of attribute historical_import.
-
#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
- #comments ⇒ Object
-
#initialize(params = {}) ⇒ Client
constructor
A new instance of Client.
- #posts ⇒ Object
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_key ⇒ Object
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
36 37 38 |
# File 'lib/circle_orbit/client.rb', line 36 def circle_community_id=(value) @circle_community_id = value end |
#circle_url ⇒ Object
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_import ⇒ Object
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_key ⇒ Object
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_workspace ⇒ Object
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
#comments ⇒ Object
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 |
#posts ⇒ Object
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 |