Module: Redd::Thing::Messageable

Included in:
Object::Subreddit, Object::User
Defined in:
lib/redd/thing/messageable.rb

Instance Method Summary collapse

Instance Method Details

#send_message(subject, text, captcha = nil, identifier = nil) ⇒ Object



6
7
8
9
10
11
12
13
14
15
# File 'lib/redd/thing/messageable.rb', line 6

def send_message(subject, text, captcha = nil, identifier = nil)
  to = case self
       when Redd::Object::Subreddit
         "/r/" + display_name
       when Redd::Object::User
         name
       end

  client.send_message(to, subject, text, captcha, identifier)
end