class Stride::BotMention::ContentBlock

Attributes

json[RW]

Public Class Methods

factory(json_block) click to toggle source
# File lib/stride/bot_mention.rb, line 50
def self.factory(json_block)
  json_block['type'] == 'text' ? TextBlock.new(json_block) : MentionBlock.new(json_block)
end
new(json) click to toggle source
# File lib/stride/bot_mention.rb, line 54
def initialize(json)
  self.json = json
end
wrap(json) click to toggle source
# File lib/stride/bot_mention.rb, line 45
def self.wrap(json)
  json = json['content'] if json.has_key?('content')
  json.map { |json_block| factory(json_block) }
end

Public Instance Methods

mention?() click to toggle source
# File lib/stride/bot_mention.rb, line 66
def mention?
  false
end
text?() click to toggle source
# File lib/stride/bot_mention.rb, line 62
def text?
  false
end
type() click to toggle source
# File lib/stride/bot_mention.rb, line 58
def type
  json['type']
end