Class: Smyte::Notification::Label
- Inherits:
-
Object
- Object
- Smyte::Notification::Label
- Defined in:
- lib/smyte/notification.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#action ⇒ Object
returns :block, :review, :allow, :unknown.
- #experimental? ⇒ Boolean
-
#initialize(response) ⇒ Label
constructor
A new instance of Label.
Constructor Details
#initialize(response) ⇒ Label
Returns a new instance of Label.
83 84 85 86 |
# File 'lib/smyte/notification.rb', line 83 def initialize(response) @name = response["labelName"] @response = response end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
82 83 84 |
# File 'lib/smyte/notification.rb', line 82 def name @name end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
82 83 84 |
# File 'lib/smyte/notification.rb', line 82 def response @response end |
Instance Method Details
#action ⇒ Object
returns :block, :review, :allow, :unknown
89 90 91 |
# File 'lib/smyte/notification.rb', line 89 def action @action ||= calculate_action end |
#experimental? ⇒ Boolean
93 94 95 |
# File 'lib/smyte/notification.rb', line 93 def experimental? response["labelType"] == "PENDING" end |