class Smyte::Classification

Attributes

options[R]
response[R]

Public Class Methods

allowed() click to toggle source
# File lib/smyte/classification.rb, line 5
def self.allowed
  new('verdict' => "ALLOW", 'labels' => {})
end
new(response, options={}) click to toggle source
# File lib/smyte/classification.rb, line 11
def initialize(response, options={})
  @response = response
  @options  = options || {}
end

Protected Instance Methods

parse_labels() click to toggle source
# File lib/smyte/classification.rb, line 18
def parse_labels
  out = []
  labels = response["labels"] || {}
  labels.each do |name, attributes|
    next unless ::Smyte::Util.label_interesting?(name, options)
    out << Smyte::Classification::Label.new(name, attributes)
  end
  out
end