Class: SimpleSlack::Toggl
- Inherits:
-
Object
- Object
- SimpleSlack::Toggl
- Includes:
- TogglDailyreport, TogglParameter
- Defined in:
- lib/simple_slack/toggl.rb
Constant Summary collapse
- URL =
"https://toggl.com/"- TIMER_URL =
"#{URL}app/timer"
Instance Attribute Summary collapse
-
#post_bot_image ⇒ Object
Returns the value of attribute post_bot_image.
-
#post_bot_name ⇒ Object
Returns the value of attribute post_bot_name.
-
#post_channels ⇒ Object
Returns the value of attribute post_channels.
-
#post_ims ⇒ Object
Returns the value of attribute post_ims.
-
#simple_client ⇒ Object
Returns the value of attribute simple_client.
-
#toggl_client ⇒ Object
Returns the value of attribute toggl_client.
Instance Method Summary collapse
- #configure {|_self| ... } ⇒ Object
-
#initialize(toggl_api_token, simple_slack_client) ⇒ Toggl
constructor
A new instance of Toggl.
- #post_message(type = :regular) ⇒ Object
Methods included from TogglDailyreport
#dailyreport, #today_entry_reports
Methods included from TogglParameter
#project, #projects, #tag, #tags, #user, #workspace, #workspaces
Methods included from TogglSendParameter
#send_after_noon_message, #send_dailyreport_message, #send_morning_message, #send_night_message, #send_noon_message, #send_regular_message
Methods included from TogglEntriesParameter
#day_entries, #entries, #entry_info, #entry_info_hash, #latest_entry, #working_entry
Constructor Details
#initialize(toggl_api_token, simple_slack_client) ⇒ Toggl
Returns a new instance of Toggl.
14 15 16 17 18 19 20 21 |
# File 'lib/simple_slack/toggl.rb', line 14 def initialize(toggl_api_token, simple_slack_client) @toggl_client = TogglV8::API.new(toggl_api_token) @simple_client = simple_slack_client @post_bot_name = "slacker" @post_bot_image = ":joy:" @post_channels = [] @post_ims = [] end |
Instance Attribute Details
#post_bot_image ⇒ Object
Returns the value of attribute post_bot_image.
9 10 11 |
# File 'lib/simple_slack/toggl.rb', line 9 def post_bot_image @post_bot_image end |
#post_bot_name ⇒ Object
Returns the value of attribute post_bot_name.
9 10 11 |
# File 'lib/simple_slack/toggl.rb', line 9 def post_bot_name @post_bot_name end |
#post_channels ⇒ Object
Returns the value of attribute post_channels.
9 10 11 |
# File 'lib/simple_slack/toggl.rb', line 9 def post_channels @post_channels end |
#post_ims ⇒ Object
Returns the value of attribute post_ims.
9 10 11 |
# File 'lib/simple_slack/toggl.rb', line 9 def post_ims @post_ims end |
#simple_client ⇒ Object
Returns the value of attribute simple_client.
9 10 11 |
# File 'lib/simple_slack/toggl.rb', line 9 def simple_client @simple_client end |
#toggl_client ⇒ Object
Returns the value of attribute toggl_client.
9 10 11 |
# File 'lib/simple_slack/toggl.rb', line 9 def toggl_client @toggl_client end |
Instance Method Details
#configure {|_self| ... } ⇒ Object
23 24 25 |
# File 'lib/simple_slack/toggl.rb', line 23 def configure yield self end |
#post_message(type = :regular) ⇒ Object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 |
# File 'lib/simple_slack/toggl.rb', line 27 def (type = :regular) case type.to_s when "morning" () when "regular" () when "noon" () when "after_noon" () when "night" () when "dailyreport" () end end |