Class: Chatopsify::Co
- Inherits:
-
Object
- Object
- Chatopsify::Co
- Defined in:
- lib/chatopsify/co.rb
Overview
ChatOps service
Class Method Summary collapse
Instance Method Summary collapse
- #call_get(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.
10 11 12 13 14 |
# File 'lib/chatopsify/co.rb', line 10 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
16 17 18 |
# File 'lib/chatopsify/co.rb', line 16 def self.call(*args, &block) new(*args, &block) end |
Instance Method Details
#call_get(id = nil) ⇒ Object
28 29 30 31 32 |
# File 'lib/chatopsify/co.rb', line 28 def call_get(id = nil) send_get_request(id) rescue StandardError => e puts e. end |
#process(body = nil) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/chatopsify/co.rb', line 20 def process(body = nil) body ||= Chatopsify::CoLib.msg_fmt send_request(body) rescue StandardError => e puts e. end |