class Smyte::Notification::Label
Attributes
name[R]
response[R]
Public Class Methods
new(response)
click to toggle source
# File lib/smyte/notification.rb, line 83 def initialize(response) @name = response["labelName"] @response = response end
Public Instance Methods
action()
click to toggle source
returns :block, :review, :allow, :unknown
# File lib/smyte/notification.rb, line 89 def action @action ||= calculate_action end
experimental?()
click to toggle source
# File lib/smyte/notification.rb, line 93 def experimental? response["labelType"] == "PENDING" end
Protected Instance Methods
calculate_action()
click to toggle source
# File lib/smyte/notification.rb, line 99 def calculate_action case response["labelType"] when "ALLOW" return :allow when "PENDING" return :review when "ADDED", "BLOCK" return :block else return :unknown end end