Class: SlackProgress::Client
- Inherits:
-
Object
- Object
- SlackProgress::Client
- Defined in:
- lib/slack-progress/client.rb
Instance Attribute Summary collapse
-
#parsed_options ⇒ Object
readonly
Returns the value of attribute parsed_options.
Instance Method Summary collapse
-
#initialize(token, channel_id, options = {}) ⇒ Client
constructor
A new instance of Client.
- #update_progress(thread_id: nil, current_value:, max_value:) ⇒ Object
Constructor Details
#initialize(token, channel_id, options = {}) ⇒ Client
Returns a new instance of Client.
10 11 12 13 14 15 16 17 |
# File 'lib/slack-progress/client.rb', line 10 def initialize(token, channel_id, = {}) raise ArgumentError, 'Token required' if token.nil? raise ArgumentError, 'Channel ID required' if channel_id.nil? @token = token @channel_id = channel_id = OptionsParser.new().parse end |
Instance Attribute Details
#parsed_options ⇒ Object (readonly)
Returns the value of attribute parsed_options.
8 9 10 |
# File 'lib/slack-progress/client.rb', line 8 def end |
Instance Method Details
#update_progress(thread_id: nil, current_value:, max_value:) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/slack-progress/client.rb', line 19 def update_progress(thread_id: nil, current_value:, max_value:) = MessageBuilder.new(.) text = .(current_value, max_value) connection = Connection.new(@token, @channel_id) connection.send_request(text, thread_id) end |