Class: Smyte::Classification::Label

Inherits:
Object
  • Object
show all
Defined in:
lib/smyte/classification.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#nameObject (readonly)

Returns the value of attribute name.



29
30
31
# File 'lib/smyte/classification.rb', line 29

def name
  @name
end

#responseObject (readonly)

Returns the value of attribute response.



29
30
31
# File 'lib/smyte/classification.rb', line 29

def response
  @response
end

Instance Method Details

#actionObject

returns :block, :review, :allow, :unknown



36
37
38
# File 'lib/smyte/classification.rb', line 36

def action
  @action ||= calculate_action
end

#experimental?Boolean

Returns:

  • (Boolean)


40
41
42
# File 'lib/smyte/classification.rb', line 40

def experimental?
  !response["enabled"]
end