Class: Croudia::SecretMail

Inherits:
Identity show all
Includes:
Creatable
Defined in:
lib/croudia/secret_mail.rb

Constant Summary collapse

KEYS =
[
  :id_str,
  :recipient,
  :recipient_id,
  :recipient_screen_name,
  :sender,
  :sender_id,
  :sender_screen_name,
  :text,
]

Instance Method Summary collapse

Methods included from Creatable

#created_at

Methods inherited from Identity

#==, #id

Methods inherited from Base

#[], attr_reader, #attrs

Constructor Details

#initialize(attrs) ⇒ SecretMail

Returns a new instance of SecretMail.



21
22
23
24
25
26
27
# File 'lib/croudia/secret_mail.rb', line 21

def initialize(attrs)
  recipient = attrs.delete('recipient')
  sender = attrs.delete('sender')
  super(attrs)
  @attrs['recipient'] = Croudia::User.new(recipient) if recipient
  @attrs['sender'] = Croudia::User.new(sender) if sender
end