class Mention

Public Class Methods

new(json) click to toggle source
# File lib/model/mention.rb, line 4
def initialize(json)
  @json = JSON.parse(json)
end

Public Instance Methods

body() click to toggle source
# File lib/model/mention.rb, line 8
def body
  text = @json['webhook_event']['body']
  pattern = /^\[To:[0-9]*\].*\R/  # [To:123456] Rubotyさん
  return text.sub(pattern, '')
end
from_account_id() click to toggle source
# File lib/model/mention.rb, line 14
def from_account_id
  return @json['webhook_event']['from_account_id']
end
message_id() click to toggle source
# File lib/model/mention.rb, line 26
def message_id
  return @json['webhook_event']['message_id']
end
room_id() click to toggle source
# File lib/model/mention.rb, line 22
def room_id
  return @json['webhook_event']['room_id']
end
to_account_id() click to toggle source
# File lib/model/mention.rb, line 18
def to_account_id
  return @json['webhook_event']['to_account_id']
end