Sha256: df9ef03805c6cc6767c8ded9eeeb9c6e4739c32717a19883d37b5cc77fb9948c

Contents?: true

Size: 498 Bytes

Versions: 4

Compression:

Stored size: 498 Bytes

Contents

module CensorBear
  class Log < ApplicationRecord
    belongs_to :user, class_name: CensorBear.config.user_class, optional: true

    def suggestion
      return nil if response.blank?

      response['data']&.first['results']&.first['suggestion']
    end

    def rate
      return nil if response.blank?

      response['data']&.first['results']&.first['rate']
    end

    def label
      return nil if response.blank?

      response['data']&.first['results']&.first['label']
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
censor_bear-0.1.18 app/models/censor_bear/log.rb
censor_bear-0.1.17 app/models/censor_bear/log.rb
censor_bear-0.1.15 app/models/censor_bear/log.rb
censor_bear-0.1.14 app/models/censor_bear/log.rb