Class: Chatopsify::Co
- Inherits:
-
Object
- Object
- Chatopsify::Co
- Defined in:
- lib/chatopsify/co.rb
Overview
ChatOps services
Class Method Summary collapse
Instance Method Summary collapse
- #call_delete(id = nil) ⇒ Object
-
#initialize(api_key = nil) ⇒ Co
constructor
A new instance of Co.
- #process(body = nil) ⇒ Object
Constructor Details
#initialize(api_key = nil) ⇒ Co
Returns a new instance of Co.
9 10 11 12 13 |
# File 'lib/chatopsify/co.rb', line 9 def initialize(api_key = nil) @api_key = api_key || load_api_key @channel_id = load_channel_id @uri = load_uri end |
Class Method Details
.call(*args, &block) ⇒ Object
15 16 17 |
# File 'lib/chatopsify/co.rb', line 15 def self.call(*args, &block) new(*args, &block) end |
Instance Method Details
#call_delete(id = nil) ⇒ Object
27 28 29 30 31 |
# File 'lib/chatopsify/co.rb', line 27 def call_delete(id = nil) send_delete_request(id) rescue StandardError => e puts e. end |
#process(body = nil) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/chatopsify/co.rb', line 19 def process(body = nil) body ||= Chatopsify::CoLib.msg_fmt send_request(body) rescue StandardError => e puts e. end |