Class: ESM::Xm8Notification::Custom

Inherits:
Xm8Notification
  • Object
show all
Defined in:
lib/esm/model/xm8_notification/custom.rb

Instance Method Summary collapse

Instance Method Details

#to_embedObject



12
13
14
15
16
# File 'lib/esm/model/xm8_notification/custom.rb', line 12

def to_embed
  Embed.from_hash!(content.to_h).tap do |e|
    e.footer = "[#{server.server_id}] #{server.server_name}"
  end
end

#valid?Boolean

Returns:

  • (Boolean)


6
7
8
9
10
# File 'lib/esm/model/xm8_notification/custom.rb', line 6

def valid?
  Embed.from_hash!(content.to_h)
rescue ArgumentError
  false
end