Class: Remind101::Command::Messages
- Inherits:
-
Base
- Object
- Base
- Remind101::Command::Messages
- Defined in:
- lib/remind101/command/messages.rb
Overview
send messages
Instance Method Summary collapse
-
#create ⇒ Object
messages:create [MESSAGE].
Instance Method Details
#create ⇒ Object
messages:create [MESSAGE]
send a new message
-c, –code CODE # the group code to send the message to
Examples
$ remind101 send “Don’t forget to study!” -c math101
17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/remind101/command/messages.rb', line 17 def create body = shift_argument validate_arguments! group = remind101.groups.find { |g| g.name == [:code] } error("Unable to find a group with that code") if group.nil? attributes = { body: body, group_ids: [ group.id ] } action "Sending message: #{body}" do remind101. attributes end end |