Sha256: 21fcd1fd356eb548149e0036c94a591f46a81752f72cfc2a4e2efb5b38b34355
Contents?: true
Size: 1.13 KB
Versions: 3
Compression:
Stored size: 1.13 KB
Contents
# frozen_string_literal: true require "net/http" require "json" module CircleOrbit class Orbit def self.call(type:, data:, orbit_workspace:, orbit_api_key:) if type == "post" CircleOrbit::Interactions::Post.new( post_title: data["name"], body: data["body"]["body"], created_at: data["body"]["created_at"], id: data["body"]["record_id"], space: data["space_name"], url: data["url"], author: data["user_name"], email: data["user_email"], workspace_id: orbit_workspace, api_key: orbit_api_key ) end if type == "comment" CircleOrbit::Interactions::Comment.new( post_title: data["post_name"], body: data["body"]["body"], created_at: data["body"]["created_at"], id: data["body"]["record_id"], space: data["space_slug"].gsub(/-/, " ").capitalize, url: data["url"], author: data["user_name"], email: data["user_email"], workspace_id: orbit_workspace, api_key: orbit_api_key ) end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
circle_orbit-0.2.0 | lib/circle_orbit/orbit.rb |
circle_orbit-0.1.0 | lib/circle_orbit/orbit.rb |
circle_orbit-0.0.2 | lib/circle_orbit/orbit.rb |