Class: TeamsIncomingClients::TargetDateClient

Inherits:
Client
  • Object
show all
Defined in:
lib/teams_incoming_clients/models/target_date_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, target_days) ⇒ PostResult

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

Examples:

client.post(“hello world”, 25)

Parameters:

  • text (String)

    送信するメッセージ

  • target_days (Array, Integer)

    送信したい日付。配列で複数条件を渡すことも可能

Returns:



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

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