Class: Smyte::Classification::Label
- Inherits:
-
Object
- Object
- Smyte::Classification::Label
- Defined in:
- lib/smyte/classification.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(name, response) ⇒ Label
constructor
A new instance of Label.
Constructor Details
#initialize(name, response) ⇒ Label
Returns a new instance of Label.
30 31 32 33 |
# File 'lib/smyte/classification.rb', line 30 def initialize(name, response) @name = name @response = response end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
29 30 31 |
# File 'lib/smyte/classification.rb', line 29 def name @name end |
#response ⇒ Object (readonly)
Returns the value of attribute response.
29 30 31 |
# File 'lib/smyte/classification.rb', line 29 def response @response end |
Instance Method Details
#action ⇒ Object
returns :block, :review, :allow, :unknown
36 37 38 |
# File 'lib/smyte/classification.rb', line 36 def action @action ||= calculate_action end |
#experimental? ⇒ Boolean
40 41 42 |
# File 'lib/smyte/classification.rb', line 40 def experimental? !response["enabled"] end |