Class: TeamsIncomingClients::DayOfWeekClient

Inherits:
Client
  • Object
show all
Defined in:
lib/teams_incoming_clients/models/day_of_week_client.rb

Constant Summary

Constants included from Modules::ClientConfigure

Modules::ClientConfigure::VALID_CONFIG_KEYS

Instance Method Summary collapse

Methods inherited from Client

#initialize

Methods included from Modules::ClientConfigure

#configure

Constructor Details

This class inherits a constructor from TeamsIncomingClients::Client

Instance Method Details

#post(text, week_of_days) ⇒ PostResult

指定した曜日であればメッセージを送信する

Examples:

client.post(“hello world”, :monday)

Parameters:

  • text (String)

    送信するメッセージ

  • week_of_days (Array, String, Symbol)

    送信したいときの曜日の英語文字列。配列で複数条件を渡すことも可能

Returns:



9
10
11
12
13
14
15
# File 'lib/teams_incoming_clients/models/day_of_week_client.rb', line 9

def post(text, week_of_days)
  if post_week_of_day?(week_of_days)
    post_message(text)
  else
    PostResult.new(false, :not_post, "Today is not #{week_of_days}")
  end
end